/auth0-mailchimp-export

Allows Auth0 Customers to synchronize their Auth0 User base (those that have an email) with a MailChimp List

Primary LanguageJavaScript

Auth0 MailChimp Export

Auth0 Extensions

This extension fork allows Auth0 customers to synchronize their Auth0 userbase (those that have an email address, and one that is verified) with a MailChimp list.

From within MailChimp, it is then possible to leverage all the benefits of marketing emails, automated messages and targeted campaigns.

More than 14 million people and businesses around the world use MailChimp. The MailChimp features and integrations allow you to send marketing emails, automated messages, and targeted campaigns. And the detailed reports help you keep improving over time.

For further information on MailChimp, please see https://mailchimp.com/about/ This extension was inspired by this mailchimp forum post by Eugenio.

Configure Webtask

If you haven't configured Webtask on your machine, run this first:

npm i -g wt-cli
wt init

Requires at least node 4.2.2. If you're running multiple version of node, make sure to load the right version, e.g. nvm use 4.2.2

Running Locally

To run the sample locally:

  1. Create an application (client) in Auth0.
  2. Go to Auth0 API Management and create a Client Grant.
{
	"audience": "https://YOUR_TENANT.auth0.com/api/v2/",
	"client_id": "YOUR_CLIENT_ID",
	"scope": ["read:users", "read:user_idp_tokens"]
}
  1. Run npm install
  2. Run
webpack && \
wt serve build/bundle.js --port 3000 --no-merge \
--secret AUTH0_DOMAIN="YOUR_TENANT.auth0.com" \
--secret AUTH0_CLIENT_ID="YOUR_CLIENT_ID" \
--secret AUTH0_CLIENT_SECRET="YOUR_CLIENT_SECRET" \
--secret MAILCHIMP_API_KEY="YOUR_MAILCHIMP_API_KEY" \
--secret MAILCHIMP_LIST_NAME="YOUR_MAILCHIMP_LIST_NAME" \
--secret UPDATE_DAYS="1"

Then, in a separate terminal, just curl 0.0.0.0:3000 to execute.

Note: The client and client grant will be created automatically when deploying through Auth0 Extensions.

Note: For more information about how to get your_tenant_profile, click here.

Deploying to Auth0 Extensions

  1. Go to Auth0 Extensions
  2. Click on + Create Extension
  3. Fill in the textbox with your GitHub repository URL
  4. Click on continue
  5. Finally, click on install

Note: do not specify * for the UPDATE_DAYS parameter when running on Auth0 if your userbase is large. The script will prematurely terminate due to Auth0's Webtask timeout restrictions if the script takes longer than 30 seconds to execute.

Usage

Go to your MailChimp account and inspect the List (Lists -> List Name). Here you will see a synchronized list of email users that correspond to those defined in your Auth0 account. Note that it will only synchronize users who meet the following criteria:

  • Have an email address
  • Have verified their email address
  • Their email address does not contain a "+" symbol

You can retrieve your MailChimp API key from (Account -> Extras -> API Keys).

For information on getting started with MailChimp API documentation, please refer to:

MailChimp Documentation

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section.