Skip to content

Commit

Permalink
Disable lodash template's escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Convly committed Jan 9, 2023
1 parent 7c391c2 commit 6f07d33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/core/email/server/services/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ const sendTemplatedEmail = (emailOptions = {}, emailTemplate = {}, data = {}) =>
(compiled, attribute) =>
emailTemplate[attribute]
? Object.assign(compiled, {
[attribute]: _.template(emailTemplate[attribute], { interpolate, evaluate: false })(
data
),
[attribute]: _.template(emailTemplate[attribute], {
interpolate,
evaluate: false,
escape: false,
})(data),
})
: compiled,
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ module.exports = ({ strapi }) => ({
const interpolate = createStrictInterpolationRegExp(allowedTemplateVariables, 'g');

try {
return _.template(layout, { interpolate, evaluate: false })(data);
return _.template(layout, { interpolate, evaluate: false, escape: false })(data);
} catch (e) {
throw new errors.ApplicationError('Invalid email template');
}
Expand Down

0 comments on commit 6f07d33

Please sign in to comment.