generateEmailMessage()
instead of generateEmailHTML()
and generateEmailSubject()
#2132
berndb
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
in our payload project we send a lot of different emails.
we have a helper class which renders all the different emails and return
Message
instances which can then be passed topayload. sendEmail(message: Message)
.however for the
verify
andforgotPassword
configuration, we cannot return a Message instance. instead, we have to rip the message apart into a function which returns the subject and another function which returns the html.it currently looks like this:
it would be nice to have the option to configure a
generateEmailMessage
function which accepts a Message instance as return value:This way, it would be more efficient because the messages would not have to be rendered twice and it would also be possible to return a different
from
address instead of the default from address. (and maybe even all other attributes supported by Nodemailer, like attachments, plain text, etc.)Beta Was this translation helpful? Give feedback.
All reactions