mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
Fixed missing domain for default support address
no issue - By default for new sites, support address is set same as from address to `noreply` , with full email address using the domain for `@` - For newsletter emails, the support address was missing the default site domain to be added to address if its `noreply` - Fix updates the support address to use the same format as from address and add relevant domain for default case
This commit is contained in:
parent
91bca9f109
commit
dd6ac57aca
@ -81,8 +81,10 @@ module.exports = {
|
||||
}
|
||||
|
||||
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;
|
||||
let supportAddress = message.supportAddress;
|
||||
delete message.supportAddress;
|
||||
const replyAddressOption = settingsCache.get('members_reply_address');
|
||||
const replyToAddress = (replyAddressOption === 'support') ? supportAddress : fromAddress;
|
||||
fromAddress = blogTitle ? `"${blogTitle}"<${fromAddress}>` : fromAddress;
|
||||
|
||||
const chunkedRecipients = _.chunk(recipients, BATCH_SIZE);
|
||||
|
@ -17,6 +17,7 @@ const getEmailData = async (postModel, memberModels = []) => {
|
||||
const {emailTmpl, replacements} = await postEmailSerializer.serialize(postModel);
|
||||
|
||||
emailTmpl.from = membersService.config.getEmailFromAddress();
|
||||
emailTmpl.supportAddress = membersService.config.getEmailSupportAddress();
|
||||
|
||||
// update templates to use Mailgun variable syntax for replacements
|
||||
replacements.forEach((replacement) => {
|
||||
|
@ -44,9 +44,18 @@ class MembersConfigProvider {
|
||||
return fromAddress;
|
||||
}
|
||||
|
||||
getEmailSupportAddress() {
|
||||
const supportAddress = this._settingsCache.get('members_support_address') || 'noreply';
|
||||
|
||||
// Any fromAddress without domain uses site domain, like default setting `noreply`
|
||||
if (supportAddress.indexOf('@') < 0) {
|
||||
return `${supportAddress}@${this._getDomain()}`;
|
||||
}
|
||||
return supportAddress;
|
||||
}
|
||||
|
||||
getAuthEmailFromAddress() {
|
||||
const supportAddress = this._settingsCache.get('members_support_address');
|
||||
return supportAddress || this.getEmailFromAddress();
|
||||
return this.getEmailSupportAddress() || this.getEmailFromAddress();
|
||||
}
|
||||
|
||||
getPublicPlans() {
|
||||
|
Loading…
Reference in New Issue
Block a user