Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated message to support sending leaf futures without unwrapping #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

twof
Copy link
Collaborator

@twof twof commented Mar 25, 2019

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)

@Steven4294
Copy link

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