Open
Description
Hi,
Great library, works really well.
The only issue I am having is using a Leaf template. The example code in the readme is generating an error in Xcode for me.
router.post("mail") { (req) -> Future<Response> in
let content = try req.view().render("Emails/my-email", [
"name": "Bob"
])
let message = Mailgun.Message(
from: "postmaster@example.com",
to: "example@gmail.com",
subject: "Newsletter",
text: "",
html: content
)
let mailgun = try req.make(Mailgun.self)
return try mailgun.send(message, on: req)
}
content
is of type Future<View>
, but Mailgun.Message
expect a String
for the html
parameter.
Is there a way around this or am I missing something obvious?
I have tried html: "\(content)"
, but my Leaf template then generates: NIO.EventLoopFuture
in the email.
Thanks in advance,
Nick
Metadata
Metadata
Assignees
Labels
No labels