diff --git a/packages/backend/package.json b/packages/backend/package.json index a06fd9156b..aee3854ef3 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -132,6 +132,7 @@ "json5": "2.2.3", "jsonld": "8.3.2", "jsrsasign": "11.1.0", + "juice": "11.0.0", "meilisearch": "0.41.0", "mfm-js": "0.24.0", "microformats-parser": "2.0.2", diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts index 435dbbae28..37fa58bb65 100644 --- a/packages/backend/src/core/EmailService.ts +++ b/packages/backend/src/core/EmailService.ts @@ -5,6 +5,7 @@ import { URLSearchParams } from 'node:url'; import * as nodemailer from 'nodemailer'; +import juice from 'juice'; import { Inject, Injectable } from '@nestjs/common'; import { validate as validateEmail } from 'deep-email-validator'; import { MetaService } from '@/core/MetaService.js'; @@ -61,14 +62,7 @@ export class EmailService { } : undefined, } as any); - try { - // TODO: htmlサニタイズ - const info = await transporter.sendMail({ - from: meta.email!, - to: to, - subject: subject, - text: text, - html: ` + const htmlContent = `
@@ -147,7 +141,18 @@ export class EmailService { ${ this.config.host } -`, +