Skip to content

Updated message to support sending leaf futures without unwrapping#28

Open
twof wants to merge 1 commit into
mainfrom
leafSupport
Open

Updated message to support sending leaf futures without unwrapping#28
twof wants to merge 1 commit into
mainfrom
leafSupport

Conversation

@twof

@twof twof commented Mar 25, 2019

Copy link
Copy Markdown
Collaborator

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: "hello@mail.com",
    to: "recipient@mail.com",
    subject: "Hey There!",
    text: "",
    html: .leaf(content)
)

let mailgun = try req.make(Mailgun.self)
return try mailgun.send(message, on: req)

@Steven4294

Copy link
Copy Markdown

could we get this merged? @twof

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants