-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Application and Request extensions
- Loading branch information
1 parent
e2d8bed
commit d57d422
Showing
2 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import Vapor | ||
|
||
extension Request { | ||
public var mailgun: MailgunStorage { | ||
application.mailgun | ||
/// Mailgun with default domain. | ||
/// Default domain should be configured in advance through `app.mailgun.defaultDomain` | ||
public func mailgun() -> Mailgun { | ||
application.mailgun() | ||
} | ||
|
||
public func mailgun(_ domain: MailgunDomain? = nil) -> Mailgun { | ||
/// Mailgun with selected domain. | ||
public func mailgun(_ domain: MailgunDomain) -> Mailgun { | ||
application.mailgun(domain) | ||
} | ||
} |