©️
Cross api
En-US
En-US
  • Introduction
  • Compatibility
  • Extensions
  • Usage
    • Tools
      • Config
      • ListProvider
      • Language
      • Help
    • Structure
      • MakeApi
      • MakeModule
      • MakeProvider
      • Revert
  • Structure
    • Root
    • Src
    • @Types
    • Assets
    • Config
    • Dtos
    • Jobs
    • Keys
    • Middlewares
    • Modules
    • Routes
    • Shared
    • Utils
  • Services
    • Transactions
    • Exists
    • FindBy
    • FindIn
    • FindLike
    • FindAll
    • Create
    • CreateMany
    • Update
    • UpdateMany
    • Delete
    • DeleteMany
    • SoftDelete
    • SoftDeleteMany
  • Mappers
    • CloneAttribute
    • UpdateAttribute
    • PatchAttribute
    • UpdateString
    • PatchString
    • InsertAttribute
  • Providers
    • Cache
    • Crypto
    • Hash
    • Lead
    • MailTemplate
    • Mail
    • Queue
    • Notification
    • Storage
Powered by GitBook
On this page
  • Available:
  • Methods:

Was this helpful?

  1. Providers

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.

<h3>It's a pleasure to have you here {{description}}</h3>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Greeting</title>
</head>
<body>
  <h1>Hello {{name}}</h1>
  {{> component}}
</body>
</html>
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' },
    }
  ],
});

PreviousLeadNextMail

Last updated 3 months ago

Was this helpful?