Vapor 4 support
Mailgun now supports Vapor 4! Development for Vapor 4 will be done on master
from here on out and Vapor 3 development will be done on the vapor3
branch.
import Mailgun
// Called before your application initializes.
func configure(_ app: Application) throws {
/// case 1
/// put into your environment variables the following keys:
/// MAILGUN_API_KEY=...
app.mailgun.configuration = .environment
/// case 2
/// manually
app.mailgun.configuration = .init(apiKey: "<api key>")
}
// call it without arguments to use default domain
app.mailgun().send(...)
req.mailgun().send(...)
// or call it with domain
app.mailgun(.myApp1).send(...)
req.mailgun(.myApp1).send(...)