mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-16 06:39:43 -06:00
updated code for new package
This commit is contained in:
@@ -85,7 +85,7 @@ const startApp = async () => {
|
||||
|
||||
app.use("/api/v1/mail", async (req, res) => {
|
||||
try {
|
||||
const id = await req.emailSerivce.buildAndSendEmail(
|
||||
const id = await req.emailService.buildAndSendEmail(
|
||||
"welcomeEmailTemplate",
|
||||
{
|
||||
name: "Alex",
|
||||
|
||||
@@ -2,7 +2,7 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const nodemailer = require("nodemailer");
|
||||
const { compile } = require("handlebars");
|
||||
const { mjml2html } = require("mjml");
|
||||
const mjml2html = require("mjml");
|
||||
|
||||
/**
|
||||
* Represents an email service that can load templates, build, and send emails.
|
||||
@@ -68,7 +68,7 @@ class EmailService {
|
||||
buildAndSendEmail = async (template, context, to, subject) => {
|
||||
const buildHtml = (template, context) => {
|
||||
const mjml = this.templateLookup[template](context);
|
||||
const html = mjml2html(mjml);
|
||||
const html = mjml2html(mjml).html;
|
||||
return html;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user