MailTemplate

An implementation of a parser for assembling email bodies.

Available:

  • Handlebars

  • Fake

Methods:

Parse: Processes the .hbs file, replacing variables in the template with the values provided.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Greeting</title>
</head>
<body>
  <h1>Hello {{name}}</h1>
</body>
</html>
const content = this.mailTemplateProvider.parse({
  file: resolve('..', 'file.hbs'),
  variables: { name: 'your name' },
});

Last updated