Ghost/ghost/staff-service/lib/email-templates/mention-report.txt.js
Rishabh Garg 61afa94a4e
Fixed plaintext for mentions email report (#16517)
closes https://github.com/TryGhost/Team/issues/2754

Updates plaintext version for mentions email report to include all unique mentions in a nice list format.
2023-03-29 00:36:05 +05:30

20 lines
610 B
JavaScript

module.exports = function (data) {
const {mentions} = data;
// Create a list of new mentions with a link to the source
const mentionsList = mentions.map((mention) => {
return `- ${mention.sourceSiteTitle} (${mention.sourceUrl})`;
}).join('\n');
// Be careful when you indent the email, because whitespaces are visible in emails!
return `
You have been mentioned recently. Here's where:
${mentionsList}
---
Sent to ${data.toEmail} from ${data.siteDomain}.
If you would no longer like to receive these notifications you can adjust your settings at ${data.staffUrl}.
`;
};