Fixed weird behavior of MailChimp API where it wouldn't update not-yet-confirmed subscribers' email addresses when changed and we'd end up sending the opt-in email a zillion times.

This commit is contained in:
Nick Winter 2015-02-09 15:33:59 -08:00
parent c4620a7b2d
commit 91b6f1759d

View file

@ -123,6 +123,7 @@ UserSchema.statics.updateServiceSettings = (doc, callback) ->
params.update_existing = true
onSuccess = (data) ->
data.email = doc.get('email') # Make sure that we don't spam opt-in emails even if MailChimp doesn't udpate the email it gets in this object until they have confirmed.
doc.set('mailChimp', data)
doc.updatedMailChimp = true
doc.save()