A simple node script which watched your firebase database and adds users to a mailchimp list
This simple script runs and adds any new users to a firebase database and adds them to a mailchimp list.
Simply run:
npm install
Followed by:
node firebase-to-mailchimp.js
The script will watch the 'users' database and add anyone not on the list to the mailchimp list.
Here is my database structure this script is based off
"users": {
"uid": {
"name": "Test McTestface",
"email": "[email protected]",
"mailchimp": false
}
}
Once the user has been added successfully it will output
Adding firebase user [email protected](uid) to the mailchimp list.
It will also change the mailchimp: false in the database to be true, so not to add it the list again.
If an error occurs it will return the error to the console.