Closed mr-White closed 6 years ago
One other thing, I had to create index.pug
instead of html.pug
for my template's HTML code. Not sure if it's still using index.pug
instead, but I got to get working on something else now so I'll check back another time.
It's using index. Why not use email.send?
On Oct 23, 2017 6:10 PM, "Michael Lage" notifications@github.com wrote:
One other thing, I had to create index.pug instead of html.pug for my template's HTML code. Not sure if it's still using index.pug instead, but I got to get working on something else now so I'll check back another time.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/niftylettuce/email-templates/issues/255#issuecomment-338811760, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf7hefJTKKcEbvATeFvGLWwyRvZqdXHks5svQ7MgaJpZM4QDgbY .
@niftylettuce I tried at first, but I'm using Mailgun's API as my mailer.
Simple answer, it was less work to get sending emails again when using the module mailgun-js
to send the emails via Mailgun's API.
Why can't you use the Mailgun transport for Nodemailer?
On Oct 23, 2017 6:26 PM, "Michael Lage" notifications@github.com wrote:
@niftylettuce https://github.com/niftylettuce I tried at first, but I'm using Mailgun's API as my mailer.
Simple answer, it was less work to get sending emails again when using the module mailgun-js to send the emails via Mailgun's API.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/niftylettuce/email-templates/issues/255#issuecomment-338815036, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf7hV59Vz8alrP87f6b9Fock8ofcVKwks5svRKmgaJpZM4QDgbY .
@niftylettuce I can use Mailgun transport for Nodemailer. I haven't before - got any code examples?
@niftylettuce I'm guessing something like this would work? https://www.npmjs.com/package/nodemailer-mailgun-transport
You don't even need that. It's built in!
https://nodemailer.com/smtp/well-known/
Just specify "Mailgun" as the "service".
On Mon, Oct 23, 2017 at 6:30 PM, Michael Lage notifications@github.com wrote:
@niftylettuce https://github.com/niftylettuce I'm guessing something like this would work? https://www.npmjs.com/package/ nodemailer-mailgun-transport
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/niftylettuce/email-templates/issues/255#issuecomment-338815684, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf7hbft08I5HAQonDAXYKfmA23PdalMks5svRNsgaJpZM4QDgbY .
-- @niftylettuce
@niftylettuce that sounds awesome! I got some other work that I need to finish first, but once I'm done, I'll give it a shot.
Thank you!!
@niftylettuce that was easy!
Thank you, again! The code is a lot cleaner :D
I followed the guide to upgrading. It states that one must call
email.render(locals)
to render a template.I get an error stating it's expecting a String. After some tinkering, I found that String to be the name of the template.
I did get email-templates module working. It works as follows:
Once that promise resolves, I create a new object and use mailgun-js to send the rendered HTML email. Side question, is there a way to get the
render()
to return an object of HTML, Subject, and Text? If not, no worries, I just need to adjust my setup a little.