- Add support for welcome email on user creation (both OAuth and password users) - Add support for html/text templating on verify email. - Add support for html/text templating on reset password. - Add handlers for converting Handlebars templates to HTML and text (template agnostic). - Add helper function sendEmail() for compiling and sending templates via Email.send() (SMTP).
10 lines
375 B
JavaScript
10 lines
375 B
JavaScript
import handlebars from 'handlebars';
|
|
|
|
export default (handlebarsMarkup, context) => {
|
|
if (handlebarsMarkup && context) {
|
|
const template = handlebars.compile(handlebarsMarkup);
|
|
return template(context);
|
|
}
|
|
|
|
throw new Error('Please pass Handlebars markup to compile and a context object with data mapping to the Handlebars expressions used in your template.');
|
|
};
|