superlogin icon indicating copy to clipboard operation
superlogin copied to clipboard

Need more flexibility on the email template

Open micky2be opened this issue 8 years ago • 5 comments

Right now the only thing we can do through the config is to give the path of the template file.

Ideally I would like to add more generic data in the template based on my server setup, and then feed the result to superlogin. So could be nice to be able to give also a string (or bugger) as a template instead of only a file path.

micky2be avatar Jun 22 '16 07:06 micky2be

I believe the template currently has access to the entire Express req object. What kind of API would you suggest to add more options?

colinskow avatar Jun 24 '16 06:06 colinskow

Basically I need to be able to set a specific domain for the reset url based on the environment (or any external data). Which might differ from req.headers.host

micky2be avatar Aug 08 '16 03:08 micky2be

In fact what would be very nice is to also be able to pass a string to config.emails.forgotPassword.template. This way the template could become more dynamic.

micky2be avatar Aug 08 '16 06:08 micky2be

OK, that doesn't seem very difficult. Under mailer in the config, should we create an option called templateLocals which will be passed into each email template automatically?

colinskow avatar Sep 06 '16 06:09 colinskow

Should be fine yes.

micky2be avatar Sep 06 '16 07:09 micky2be