Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Email subject templating #51

Open
25matt12 opened this issue Sep 19, 2018 · 0 comments
Open

Email subject templating #51

25matt12 opened this issue Sep 19, 2018 · 0 comments

Comments

@25matt12
Copy link

25matt12 commented Sep 19, 2018

Hi,

Is it possible to use variables in the subject of the email? I need something dynamic for this part of the email too.

if not, maybe just adding a function like that would solve the problem:

(user) => {
    // returns the dynamic subject
    return `Hello ${user.username}`
}

And this could be added in the configuration like that:

passwordResetEmail: {
          subject: 'reset password',
          // optionnal
          subjectConstructor: (user) => {
                  return `Hello ${user.username}`
          },
          pathHtml: resolve(__dirname, 'templates/reset_password_email.html'),
          pathPlainText: '',
          callback: (user) => { return {
            firstName: user.get('firstName')
          }}
}

What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant