Skip to content

Instantly share code, notes, and snippets.

@benjohnson77
Last active December 21, 2015 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjohnson77/6234844 to your computer and use it in GitHub Desktop.
Save benjohnson77/6234844 to your computer and use it in GitHub Desktop.
adding user to mailchimp with Gibbon gem
def self.subscribe_user_batch(users)
batch = users.map { |user| {EMAIL: user.email, FNAME: user.first_name, LNAME: user.last_name} }
Gibbon.batch_subscribe(:id => current_marketing_list['id'], :batch => batch)
end
@benjohnson77
Copy link
Author

def self.current_marketing_list
Rails.env.production? ? bookshout_list_live : bookshout_list_test
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment