Skip to content

Instantly share code, notes, and snippets.

@araeuchle
Created August 23, 2019 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save araeuchle/c6aa4eb0bf4ed2e1adf673200f71ce7e to your computer and use it in GitHub Desktop.
Save araeuchle/c6aa4eb0bf4ed2e1adf673200f71ce7e to your computer and use it in GitHub Desktop.
func email(_ req: Request) throws -> Future<Response> {
let message = Mailgun.Message(
from: "mg@sandbox339393939393.mailgun.org",
to: "myemail@myprovider.com",
subject: "Newsletter",
text: "This is a newsletter",
html: "<h1>This is a newsletter</h1>"
)
let mailgun = try req.make(Mailgun.self)
return try mailgun.send(message, on: req)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment