No commit activity in last 3 years
No release in over 3 years
Rails Engine for MailChimp integrations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.0
~> 3.x
 Project Readme

Workarea MailChimp

MailChimp plugin for the Workarea e-commerce platform

This plugin creates a basic integration between the Workarea platform and MailChimp's v3 API.

It requires a mailchimp access token which can be generated by following MailChimp's OAuth2 Flow here: http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/.

This access token should be used as the API Key in your secrets.

Scope and Dependencies

This plugin currently wraps functionality for subscribing and unsubscribing users by email, as well as retrieving interest groups (or categories) for users and lists

It is dependant on the gibbon rubygem which provides a basic wrapper for the MailChimp v3 API.

Getting Started

Add the gem to your application's Gemfile:

# ...
gem 'workarea-mail_chimp'
# ...

Update your application's bundle.

cd path/to/application
bundle

After deploying for the first time, run this on your production server to seed products/orders into MailChimp:

rails workarea:mail_chimp:install

Additional tasks can be discovered by running rails --tasks.

Configuration

This plugin requires gateway configuration in order to function.

In your secrets file:

mail_chimp:
  :api_key: YOUR_OAUTH_ACCESS_TOKEN_OR_API_KEY
  :default_list_id: LIST_ID
  :list_preferences_id: LIST_PREFERENCES_ID

To find your default list ID, in the mailchimp admin:

  1. Go to the list you wish to use
  2. Click the settings dropdown menu
  3. Choose the 'List name and defaults' menu item
  4. You will find the List ID on this page, at the time of writing it is displayed at the top left of the page.

To find your list preferences ID via the API playground:

  1. Visit API playground
  2. Enter your API key
  3. Click on the 'Lists' Link
  4. Find the subresources dropdown for your default list
  5. Choose 'interest-categories' from the subresources dropdown
  6. Click the name of your interest group
  7. Use the ID field shown in the details section, the 'list_id' field should correspond with your default_list_id

If you're using MailChimp's own abandoned cart email functionality, you should also disable Workarea's internal emailer by including this in your initializers:

unless Workarea.config.skip_service_connections
  Sidekiq::Cron::Job.destroy('Workarea::OrderReminder')
end

Testing & Maintenance

Ensure that the gateway credentials within application secrets are set in spec/dummy/config/secrets.yml for test mode

To get specs to pass, you will need to configure a MailChimp account with the following data

  • A group/category with the same information as what is configured in HelperMethods#email_all_interests_hash in spec/fixtures/helper_methods.rb

  • A user that was unsubscribed with the following email: test-unsubscribed@weblinc.com

  • A subscribed user with the following email: mdalton-simonpearce@weblinc.com

The specs use VCR cassettes to record http requests, so maintainers will need to flush the cassettes when modifying the requests.

Workarea Commerce Documentation

See https://developer.workarea.com for Workarea Commerce documentation.

License

Workarea Mailchimp is released under the Business Software License