Updated sender address for ownership verification emails to new address

no issue

- We used existing "from" address as sender for mails sent to new email address for verification, but that breaks the flow to update if the current "from" address has DMARC policy set.
- This updates the flow to always send the ownership verification email TO the new address and FROM the new address which both verifies the email deliverability for new address and ownership
This commit is contained in:
Rish 2020-08-26 13:44:44 +05:30 committed by Rishabh Garg
parent 8d022ecfb5
commit 806d0f8e21

View File

@ -71,6 +71,20 @@ function createSettingsInstance(config) {
});
const sendEmailAddressUpdateMagicLink = ({email, payload = {}, type = 'fromAddressUpdate'}) => {
magicLinkService.transporter = {
sendMail(message) {
if (process.env.NODE_ENV !== 'production') {
logging.warn(message.text);
}
let msg = Object.assign({
from: email,
subject: 'Update email address',
forceTextContent: true
}, message);
return ghostMailer.send(msg);
}
};
return magicLinkService.sendMagicLink({email, payload, subject: email, type});
};