Coder Social home page Coder Social logo

metacall / mailchimp-example Goto Github PK

View Code? Open in Web Editor NEW
1.0 7.0 0.0 239 KB

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

Home Page: https://metacall.io

License: Apache License 2.0

JavaScript 100.00%
nodejs email mailchimp metacall

mailchimp-example's Introduction

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!

mailchimp-example's People

Contributors

dependabot[bot] avatar josead avatar viferga avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.