0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Updated newsletter emails to include reply-to address

no issue

- The newsletter emails are sent out with `from` address as sender
- The new `members_reply_address` setting is now used to set reply-to address for emails, which can be either newsletter or support address
This commit is contained in:
Rish 2020-08-26 13:32:07 +05:30 committed by Rishabh Garg
parent ca8b77182c
commit 8d022ecfb5

View file

@ -81,6 +81,8 @@ module.exports = {
} }
const blogTitle = settingsCache.get('title') ? settingsCache.get('title').replace(/"/g, '\\"') : ''; const blogTitle = settingsCache.get('title') ? settingsCache.get('title').replace(/"/g, '\\"') : '';
const supportAddress = settingsCache.get('members_support_address');
const replyToAddress = (settingsCache.get('members_reply_address') === 'support') ? supportAddress : fromAddress;
fromAddress = blogTitle ? `"${blogTitle}"<${fromAddress}>` : fromAddress; fromAddress = blogTitle ? `"${blogTitle}"<${fromAddress}>` : fromAddress;
const chunkedRecipients = _.chunk(recipients, BATCH_SIZE); const chunkedRecipients = _.chunk(recipients, BATCH_SIZE);
@ -94,6 +96,7 @@ module.exports = {
const batchData = { const batchData = {
to: toAddresses, to: toAddresses,
from: fromAddress, from: fromAddress,
'h:Reply-To': replyToAddress || fromAddress,
'recipient-variables': recipientVariables 'recipient-variables': recipientVariables
}; };