Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion email-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"nodemailer": "^8.0.4",
"pg": "^8.16.3",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.7"
"sequelize": "^6.37.7",
"isomorphic-dompurify": "^3.7.1"
},
"devDependencies": {
"@swc/jest": "^0.2.39",
Expand Down
6 changes: 3 additions & 3 deletions email-api/src/mails/mailer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nodemailer from 'nodemailer' // Se cambia la librería
import { env } from '../config/env.js'
//import DOMPurify from 'isomorphic-dompurify'; // Esta librería ya trae su propio DOM interno
import DOMPurify from 'isomorphic-dompurify'; // Esta librería ya trae su propio DOM interno

const transporter = nodemailer.createTransport({
host: "smtp.gmail.com",
Expand All @@ -17,13 +17,13 @@ const transporter = nodemailer.createTransport({

export const sendEmail = async ({ to, subject, html }) => {
// Ahora DOMPurify funciona directamente sin configurar nada más
//const cleanHtml = DOMPurify.sanitize(html);
const cleanHtml = DOMPurify.sanitize(html);

const mailOptions = {
from: env.EMAIL,
to,
subject,
html //: cleanHtml // Usamos la versión limpia
html: cleanHtml // Usamos la versión limpia
}

try {
Expand Down
Loading