Skip to content
Snippets Groups Projects
Unverified Commit e3ee3612 authored by nd's avatar nd
Browse files

add support for custom patches

parent 3cc4d93d
Branches
No related tags found
No related merge requests found
Pipeline #14917 waiting for manual action
From ae8f700cb41c4ec5d69b7a8f84fce455067796b9 Mon Sep 17 00:00:00 2001
From: marudor <marudor@marudor.de>
Date: Fri, 10 Dec 2021 13:58:59 +0100
Subject: [PATCH] fix(email): Header & Footer are also included in plaintext
emails
https://github.com/RocketChat/Rocket.Chat/pull/23928
---
app/mailer/server/api.ts | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/app/mailer/server/api.ts b/app/mailer/server/api.ts
index c59cd2151f..f97ce0823e 100644
--- a/app/mailer/server/api.ts
+++ b/app/mailer/server/api.ts
@@ -75,10 +75,6 @@ export const replaceEscaped = (str: string, data: { [key: string]: unknown } = {
};
export const wrap = (html: string, data: { [key: string]: unknown } = {}): string => {
- if (settings.get('email_plain_text_only')) {
- return replace(html, data);
- }
-
if (!body) {
throw new Error('`body` is not set yet');
}
@@ -190,8 +186,8 @@ export const send = ({
from,
replyTo,
subject: replace(subject, data),
- text: (text && replace(text, data))
- || (html && stripHtml(replace(html, data)).result)
+ text: (text && stripHtml(wrap(text, data)).result)
+ || (html && stripHtml(wrap(html, data)).result)
|| undefined,
html: html ? wrap(html, data) : undefined,
headers,
--
2.35.1
0001-fix-email-Header-Footer-are-also-included-in-plainte.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment