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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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": "[email protected]" }'

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

Contributors 3

  •  
  •  
  •