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:
Alexander Holliday authored and GitHub committed 2024-07-20 19:33:27 -07:00
commit 6410dcde6e
4 files changed
+1954 -1685

No files matched your search

+1 -1
View File
@@ -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",
+1950 -1681
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -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 -2
View File
@@ -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;
};