mailgun icon indicating copy to clipboard operation
mailgun copied to clipboard

Updated message to support sending leaf futures without unwrapping

Open twof opened this issue 5 years ago • 1 comments

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)

twof avatar Mar 25 '19 22:03 twof

could we get this merged? @twof

Steven4294 avatar Sep 18 '20 04:09 Steven4294