Coder Social home page Coder Social logo

auth0-mailchimp-export's Introduction

Auth0 MailChimp Export

Auth0 Extensions

This extension allows Auth0 Customers to synchronize their Auth0 User base (those that have an email) 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.

TODO

Review and address the Issues raised as part of code review.

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 AUTH0_CONNECTION_NAME="YOUR_AUTH0_CONNECTION_NAME" 

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

Note: The client and client grant creating will be automatically when deploying though 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

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 Connection (that have email addresses)

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.

auth0-mailchimp-export's People

Contributors

arcseldon avatar jcenturion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

auth0-mailchimp-export's Issues

Paging and cron schedule

From what I can see the cron job will run every 5 minutes, fetch the 20 first users and then send them to mailchimp.

What about the other users? Will you add paging here?

And what about customers with 10k users for example? Will these 10k users then be synched every 5 minutes? I don't think 1 cron run will be able to fetch 10k users + send them all to Mailchimp.

I think we might need to figure if we can use a "diff" sync instead of a full sync all the time. Because full syncs will probably break for customers with many users.

Would be good to validate whatever approach we come up with using a tenant with 10k/20K/50k users.

The extension does not show in the Installed Extensions

To reproduce:

  • Install the custom extension
  • Refresh the page

The issue is caused by the fact that the extension does not have a /meta endpoint (example). Once the extension is available in the gallery this endpoint will not be needed, but for now it's important to add it.

Unit tests for failures

Currently cron jobs run in the same container that are also serving rules and custom database connections. If an unhandled exception happens here, or the callback is not called for any reason, this might cause the container to be quarantined (impacting rules and database connections).

It would be good to have some unit tests that test the actual webtask and trigger some errors:

I noticed the harness folder (which are more like integration tests), but ideally here we would just have some unit tests with mocks.

Use extension tools for getting an API v2 token

The current implementation includes logic to get an API v2 token.

The extension tools already contains logic to fetch the token and also to cache it for the lifetime of the token (eg: if the token is valid for 5 minutes, the token will only be cached for 5 minutes).

This will also give us less code to maintain.

Webtask not accepting new user signups?

The documentation says the following in the section labelled "Configure Webtask":
"If you haven't configured Webtask on your machine run this first"

When one visits webtask.io; one is immediately greeted with the following notification:
"We are no longer accepting new user signups on webtask.io."

Can someone give me some guidance? Is this irrelevant or should I be using something else?

Handling deleted users

How will we handled deleted users? Should these be deleted from Mailchimp?

Whatever approach we choose, I think we should clarify this in the documentation (once we have it) so it's clear to customers.

Extended support for given name + last name

By default we are fetching the given name and last name from the user object. For database connections, it could be that these are on app_metadata or user_metadata.

The code should ideally fallback if the information is not found on the user level.

New Installations not working?

Hi,

I had used this tool on April 5th and installed the extension into my Auth0 account successfully and all of my users were exported to Mailchimp within 5 minutes. I've tried setting this up for new tenants today (following the same steps), however when i finish setting up the extension, it installs and says that it is up to date, however when i refresh the extension is no longer installed and is missing from the list.

I've also tried going back and updating the time interval of my old implementation and that does not update at all but is still active in my list.

Could this be related to the latest changes to Node that they have implemented? Or am i just doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.