Email Templates
Some of authentication strategies of Authembed require to send emails. There are some built-in templates, which look quite good, but in some situations you may need to use your own custom branded templates.
In Authembed templates are stored in directory /templates
. At this moment (version v0.1.0
) there are 3 templtes:
/templates/email-verification.hbs
- used to send email verification link;/templates/generated-password.hbs
- used to send the generated password when registering through Autogenerated Password Strategy;/templates/updated-password.hbs
- used when reseting password that was generated through Autogenerated Password Strategy.
Each of those templates end with the extension .hbs
which stands for Handlebars. But in reality templates are just regular HTML files, except that they also have somewhat called "placeholders". These placeholders are then replaces with actual values when sending messages.
Let's construct some basic custom templates!
Custom email-verification template example
email-verification
template expect only one placeholder:
confirmationUrl
- the url which will verify user's email
And here is an example of a simple custom template:
Custom generated-password template example
generated-password
template expects only one placeholder:
password
- the autogenerated password that user can use to login
And here is an example of a simple custom template:
Custom updated-password template example
updated-password.hbs
template expects only one placeholder:
password
- new autogenerated password after the old one was reset
And here is an example of a simple custom template:
Last updated
Was this helpful?