Created
November 3, 2014 16:36
-
-
Save JamesChevalier/6868539286a5c291522b to your computer and use it in GitHub Desktop.
MailChimp signup in Ruby using mailchimp-api gem without double opt-in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mailchimp' | |
mailchimp = Mailchimp::API.new(ENV['mailchimp_api_key']) | |
mailchimp.lists.subscribe(ENV['mailchimp_list_id'], | |
{ email: '[email protected]' }, | |
{ 'FNAME' => 'First Name', 'LNAME' => 'Last Name' }, | |
'html', | |
false) | |
# So the format is: | |
# mailchimp.lists.subscribe(list_id, { email: address }, { merge_vars }, 'email type', double_optin_boolean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why they would default double opt-in to true is beyond me. If you're adding people through an API, how would that ever be the intended behavior? Oh well. Thanks for this!