MailTemplate
Uma implementação de um analisador para montagem de corpos de e-mail.
Disponíveis:
Handlebars
Fake
Métodos:
Compile: Processa o arquivo .hbs
, substituindo variáveis no template pelos valores fornecidos.
<h3>É um prazer ter você aqui {{description}}</h3>
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<title>Saudação</title>
</head>
<body>
<h1>Olá {{name}}</h1>
{{> component}}
</body>
</html>
const content = this.mailTemplateProvider.compile({
file: resolve('..', 'file.hbs'),
variables: { name: 'seu nome' },
partials: [
{
name: 'component',
file: resolve('..', 'component.hbs'),
variables: { description: 'na documentação da CLI' },
}
],
});
Last updated
Was this helpful?