mailgun
mailgun copied to clipboard
Updated message to support sending leaf futures without unwrapping
Sending Leaf templates seems to be a common task for folks, so this PR makes that much easier. This is going to require a version bump and won't be tagged until a few other breaking issues have been addressed.
let content = try req.view().render("Emails/my-email", [
"name": "Bob"
])
let message = Mailgun.Message(
from: "[email protected]",
to: "[email protected]",
subject: "Hey There!",
text: "",
html: .leaf(content)
)
let mailgun = try req.make(Mailgun.self)
return try mailgun.send(message, on: req)
could we get this merged? @twof