Skip to content

Compile template to string #193

@dumalang

Description

@dumalang

Is anyone here know how to compile the template to string? I'm going to use express-hbs for email function on my project. and the function input must be an HTML in a string. The main goal is I want to use the powerful template inheritance that you guys have.

here is my code:

const emailData = {
    title: 'My Title',
  }

  t = await hbs.compile(source)
  let template = t(emailData)

  const mailService = new EmailService(
    '[email protected]',
    'registration',
    template
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions