(content)
+ const stylesheet = await fs.readFile(
+ path.join(__dirname, 'styles.css'),
+ 'utf8',
+ )
+
+ const {
+ appName = config.appName,
+ appLogo = config.appLogo,
+ supportEmail = config.supportEmail,
+ title = '',
+ } = data
- const compiledContent = contentTemplate(data)
- const emailHtml = layoutTemplate({ title: 'asdf', body: compiledContent })
- const emailHtmlInlineCss = juice(emailHtml)
+ const compiledContent = contentTemplate({
+ ...data,
+ appName,
+ appLogo,
+ title,
+ })
+ const emailHtml = layoutTemplate({
+ title,
+ appName,
+ appLogo,
+ supportEmail,
+ body: compiledContent,
+ })
+ const emailHtmlInlineCss = juice(emailHtml, { extraCss: stylesheet })
return emailHtmlInlineCss
}
diff --git a/src/templates/layout.hbs b/src/templates/layout.hbs
index a9dc602..75b4dbc 100644
--- a/src/templates/layout.hbs
+++ b/src/templates/layout.hbs
@@ -2,15 +2,17 @@
{{title}}
-
+
{{{body}}}