Skip to content

Node.js based forum software built for the modern web

fix: notification email for post queue

Barış Soner Uşaklıc4a38e754c8c
diff --git a/src/posts/queue.js b/src/posts/queue.js
index 879554520e..b50b8fc777 100644
--- a/src/posts/queue.js
+++ b/src/posts/queue.js
@@ -15,7 +15,6 @@ const plugins = require('../plugins');
const utils = require('../utils');
const cache = require('../cache');
const socketHelpers = require('../socket.io/helpers');
-const tx = require('../translator');
const helpers = require('../helpers');
const upload_url = nconf.get('relative_path') + nconf.get('upload_url');
@@ -259,9 +258,7 @@ module.exports = function (Posts) {
};
let bodyLong;
if (type === 'reply') {
- bodyLong = tx.escape(
- await plugins.hooks.fire('filter:parse.raw', data.sourceContent || data.content)
- );
+ bodyLong = await plugins.hooks.fire('filter:parse.raw', data.sourceContent || data.content);
} else {
bodyLong = helpers.escape(String(data.title));
}
@@ -304,7 +301,9 @@ module.exports = function (Posts) {
topic.url = `${url}/topic/${data.tid}`;
}
const { app } = require('../webserver');
+ const _i18n = require('../languages').getFull(meta.config.defaultLang);
return await app.renderAsync('emails/partials/post-queue-body', {
+ _i18n,
content: content,
category: category,
user: userData,
diff --git a/src/views/emails/notification.tpl b/src/views/emails/notification.tpl
index 1493af181e..3c34adf1bd 100644
--- a/src/views/emails/notification.tpl
+++ b/src/views/emails/notification.tpl
@@ -14,7 +14,7 @@
</tr>
<tr>
<td style="padding: 0px 40px; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 15px; line-height: 20px; color: #555555;">
- <h1 style="margin: 0 0 10px 0; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 18px; line-height: 21px; color: #aaaaaa; font-weight: normal;">{tx(intro)}</h1>
+ <h1 style="margin: 0 0 10px 0; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 18px; line-height: 21px; color: #aaaaaa; font-weight: normal;">{{tx(intro)}}</h1>
</td>
</tr>
<tr class="notification-body">
diff --git a/src/views/emails/partials/post-queue-body.tpl b/src/views/emails/partials/post-queue-body.tpl
index 74eccc3b0f..a649d4f8d8 100644
--- a/src/views/emails/partials/post-queue-body.tpl
+++ b/src/views/emails/partials/post-queue-body.tpl
@@ -1,9 +1,9 @@
<p><strong>[[post-queue:category]]</strong></p>
-<p><a href="{category.url}">{category.name}</a></p>
+<p><a href="{category.url}">{{tx(category.name)}}</a></p>
<p><strong>{{{ if topic.tid }}}[[post-queue:topic]]{{{ else }}}[[post-queue:title]]{{{ end }}}</strong></p>
<p>{{{ if topic.url }}}<a href="{topic.url}">{topic.title}</a>{{{ else }}}{topic.title}{{{ end }}}</p>
<p><strong>[[post-queue:user]]</strong></p>
<p>{{{ if user.url }}}<a href="{user.url}">{user.username}</a>{{{ else }}}{user.username}{{{ end }}}</p>
-<p>{content}</p>
+<p>{{txEscape(content)}}</p>