mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Updated ownership verification email flow to use different From address
no issue - In a recent change to ownership verification email flow, we changed the FROM address of ownership verification mails to use the same email as the one we are verifying, aka TO address. - Email clients like Gmail flags off such emails as possible spam - Fix updates the `FROM` address to `noreply@domain.com` where domain.com is domain for TO address - In case the TO is already noreply@domain.com, we use no-reply@domain.com to bypass the same address restriction.
This commit is contained in:
parent
7a3839fb14
commit
ac146f1e3b
1 changed files with 6 additions and 1 deletions
|
@ -71,13 +71,18 @@ function createSettingsInstance(config) {
|
|||
});
|
||||
|
||||
const sendEmailAddressUpdateMagicLink = ({email, payload = {}, type = 'fromAddressUpdate'}) => {
|
||||
const [,toDomain] = email.split('@');
|
||||
let fromEmail = `noreply@${toDomain}`;
|
||||
if (fromEmail === email) {
|
||||
fromEmail = `no-reply@${toDomain}`;
|
||||
}
|
||||
magicLinkService.transporter = {
|
||||
sendMail(message) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
logging.warn(message.text);
|
||||
}
|
||||
let msg = Object.assign({
|
||||
from: email,
|
||||
from: fromEmail,
|
||||
subject: 'Update email address',
|
||||
forceTextContent: true
|
||||
}, message);
|
||||
|
|
Loading…
Add table
Reference in a new issue