Merge pull request #399 from bluewave-labs/fix/mjml-security
Moved to alpha versin of mjml because of security vulnerabilities
This commit is contained in:
4 files changed
+1954
-1685
No files matched your search
+1
-1
@@ -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",
|
||||
|
||||
Generated
+1950
-1681
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -23,7 +23,7 @@
|
||||
"joi": "^17.13.1",
|
||||
"jsonwebtoken": "9.0.2",
|
||||
"mailersend": "^2.2.0",
|
||||
"mjml": "^1.3.4",
|
||||
"mjml": "^5.0.0-alpha.4",
|
||||
"mongoose": "^8.3.3",
|
||||
"multer": "1.4.5-lts.1",
|
||||
"nodemailer": "^6.9.14",
|
||||
|
||||
@@ -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