Closed Prechan closed 6 years ago
As long as the other values are not promises it should just work. I suspect your other values are not resolved at the time of your call to mailer.sendMail. Ensure all the values are resolved before you make that call. Additionally double check that the context keys match the template.
After tried multiples things and triple check context keys, I wasn't able to fix it !
So I tried to change templating engine, I switched to EJS, without changing the way to get values (locales etc...), and it works fine... I'm sorry because your middleware was perfect otherwise.
That kind of bug...
Yeah not sure, what the problem may have been without seeing your template. This is likely an issue either with the template or with https://github.com/ericf/express-handlebars. Feel free to open an issue there as well.
Hey !
I experienced an ankward problem here, and after hours trying things to fix it I ask some help ! Some received emails are incompleted as strings and/or variables are missing. I think that the email is send before context variable is entirely build up. I tried to wrap in async/await, but same result.
To help you understand my problem, here is how it works in code:
``
In the received email, TITLE, OR_BY_EMAIL_AT and TEAM keys are displayed, others are not. When I do a console.log(context), just before mailer.sendMail, the email send is correct.
Do you have an idea about this ? Thank you !