Added style inlining to staff service emails

no issue

- uses same `juice` version that we use in our newsletter emails
This commit is contained in:
Kevin Ansfield 2024-08-29 10:47:48 +01:00
parent e41984d0a5
commit 0647172ca8
2 changed files with 9 additions and 4 deletions

View File

@ -495,10 +495,14 @@ class StaffServiceEmails {
sharedData = await this.getSharedData(data.recipient);
}
return htmlTemplate({
const html = htmlTemplate({
...data,
...sharedData
});
const juice = require('juice');
return juice(html, {inlinePseudoElements: true, removeStyleTags: true});
}
async renderText(templateName, data) {

View File

@ -23,9 +23,10 @@
"sinon": "15.2.0"
},
"dependencies": {
"lodash": "4.17.21",
"moment": "2.29.1",
"@tryghost/email-addresses": "0.0.0",
"handlebars": "4.7.8",
"@tryghost/email-addresses": "0.0.0"
"juice": "9.1.0",
"lodash": "4.17.21",
"moment": "2.29.1"
}
}