Merge pull request #861 from sharelatex/ho-mailchimp-change-email

catch newsletter email change error if user already exists on mailing list
This commit is contained in:
Paulo Jorge Reis 2018-08-30 11:29:01 +01:00 committed by GitHub
commit 8b64f46807

View file

@ -47,6 +47,10 @@ module.exports =
logger.log {oldEmail, newEmail}, logger.log {oldEmail, newEmail},
"unable to change email in newsletter, user has previously unsubscribed or new email already exist on list" "unable to change email in newsletter, user has previously unsubscribed or new email already exist on list"
return callback(err) return callback(err)
else if err? and err.message.indexOf("is already a list member") != -1
logger.log {oldEmail, newEmail},
"unable to change email in newsletter, new email is already on mailing list"
return callback()
else if err? else if err?
logger.err {err, oldEmail, newEmail}, "error changing email in newsletter" logger.err {err, oldEmail, newEmail}, "error changing email in newsletter"
return callback(err) return callback(err)