> For the complete documentation index, see [llms.txt](https://cross-packages.gitbook.io/cross-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cross-packages.gitbook.io/cross-api/providers/mail-template.md).

# MailTemplate

An implementation of a parser for assembling email bodies.

## Available:

* Handlebars
* Fake

## Methods:

**Compile:** Processes the `.hbs` file, replacing variables in the template with the values provided.

```handlebars
<h3>It's a pleasure to have you here {{description}}</h3>
```

```handlebars
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Greeting</title>
</head>
<body>
  <h1>Hello {{name}}</h1>
  {{> component}}
</body>
</html>
```

```typescript
const content = this.mailTemplateProvider.compile({
  file: resolve('..', 'file.hbs'),
  variables: { name: 'your name' },
  partials: [
    {
      name: 'component',
      file: resolve('..', 'component.hbs'),
      variables: { description: 'in the CLI documentation' },
    }
  ],
});
```

***
