-
Notifications
You must be signed in to change notification settings - Fork 14
MailChimp issues #6
Description
Received three emails:
Hello James, I tried your launch soon project, and found some problem with the mailchimp api.
When i try to subscribe reffered user, there is problem in updating the referral. It is not working even
on your demo app, so i think it is problem of the mailchimp api.
Could you please update it? Thank you.
web ...
http://launch-soon-example.herokuapp.com/
user come with ref ... http://launch-soon-example.herokuapp.com/?ref=6744cfdc9f5b3f934d1b4d4d7ec97697
problem message:
There was a problem updating the referral at MailChimp
i think that i found the solution, there was not a conversion from string to integer, so
it was unable to increment
new_count = referring_member['merges']['RCOUNT'] + 1
changed to
new_count = referring_member['merges']['RCOUNT'].to_i + 1
Mailchimp needs to have double opt-in and if new user is created and not confirmed,
refferal cannot be found. I found a solution by turning double_optin to false, so users
do not need to confirm subscription.
mailchimp.lists.subscribe("#{MAILCHIMP_LIST_ID}",
{'email' => "#{email}"},
{'RCODE' => "#{@referral_code}", 'RCOUNT' => '0'}, false, false, false)