Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile template to string #193

Open
dumalang opened this issue Apr 22, 2020 · 1 comment
Open

Compile template to string #193

dumalang opened this issue Apr 22, 2020 · 1 comment

Comments

@dumalang
Copy link

dumalang commented Apr 22, 2020

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
  )
@monkeydjoy
Copy link

Hiii guys, i'm facing the same issues. please help..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants