Support Multiple Domains
You can now use multiple domains to send emails with Mailgun
let mailgun = Mailgun(apiKey: "<api key>")
services.register(mailgun, as: Mailgun.self)
// Put this extension at the bottom or create a new file for it
extension Mailgun.DomainConfig {
static var euDomain: Mailgun.DomainConfig {
return Mailgun.DomainConfig("mg.example.com", region: .eu)
}
static var usDomain: Mailgun.DomainConfig {
return Mailgun.DomainConfig("mg2.example.com", region: .us)
}
}
mailgun.send(message, domain: .euDomain, on: req)
The new major version for this release is 3.0.0 to align with the supported Vapor version. 4.0.0 tag coming soon.