Fork me on GitHub

devise_mailchimp by jcnnghm

Easy MailChimp integration for Devise

Devise MailChimp adds a MailChimp option to Devise that easily enables users to join your mailing list when they create an account.

Delayed Job is used automatically if your project uses it, and the mapping between list names and list ids is cached automatically.

Dependencies

Rails, Devise, Hominid

Install

In your Gemfile, add devise_mailchimp after devise:


  gem "devise"
  gem "devise_mailchimp"  # Last officially released gem
In your User model, add :mailchimp to the devise call:

  devise :database_authenticatable, ..., :mailchimp
In your devise initializer (config/initializers/devise.rb), set your API key and mailing list name:

  Devise.mailchimp_api_key = 'your_api_key'
  Devise.mailing_list_name = 'List Name'
If you are using the default Devise registration views, the Join Mailing List checkbox is added automatically, if not, either include the form partial in your new registration form:

  <%= render :partial => "devise/shared/mailchimp/form", :locals => {:form => f} %>
Or manually add a "Join Mailing List" checkbox to your new registration form:

  <%=form.check_box :join_mailing_list%>

License

MIT

Authors

Justin Cunningham (justin@compucatedsolutions.com)

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/jcnnghm/devise_mailchimp