Skip to content

A Mailchimp list subscriber endpoint written in NodeJS and how to deploy yours in MetaCall.

License

Notifications You must be signed in to change notification settings

metacall/mailchimp-example

Repository files navigation

Use MetaCall FaaS to setup your subscriber function.

Login into to MetaCall FaaS:

https://dashboard.metacall.io

Along with this Mailchimp Example repository and the branch, you simply add the environment variables corresponding to your mailchimp account configuration:

dashboard

MAILCHIMP_API_USERNAME=authusername

MAILCHIMP_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxx

MAILCHIMP_TARGET_LIST=xxxxxxxxxx

After deployment you should see something like this.

dashboard-with-deploy-in-place

Now you can start using your new async function as an endpoint using the await route

curl -X POST https://api.metacall.io/<your_alias>/mailchimp-example/v1/await/subscribe -X POST --data '{ "email": "your_email@domain.com" }'

Extra: Use Express in FaaS as webhook endpoint

If you go into mailchimp.js you can see we've instanciated an express server with an endpoint called '/webhook'. This is useful to configure a after-subscription webhook (or any of the like) and perform actions in it.

To do so, you take the url with the port route https://api.metacall.io/<your_alias>/mailchimp-example/v1/port/8080/webhook and place it in Mailchimp's webhook url box.

dashboard-with-deploy-in-place

That's it, Enjoy MetaCall!

About

A Mailchimp list subscriber endpoint written in NodeJS and how to deploy yours in MetaCall.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published