mailchimp-subscription-library
v1.0.4
Published
[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url]
Downloads
1
Readme
Mailchimp subscription library
Allows you to subscribe users to your Mailchimp list. You can use it in your favourite framework or even in plain js/ts project.
Installation
npm i mailchimp-subscription-library
Usage
- Retrieve mailchimp signup form url, something like
https://YOUR_MAILCHIMP_FORM_HOST/subscribe?u=YOUR_U&id=YOUR_FORM_ID
- Import the module
import { MailchimpSubscription } from 'mailchimp-subscription-library';
- Create a new instance and call the subscribe method
const mailchimpSubscription = new MailchimpSubscription('https://YOUR_MAILCHIMP_FORM_HOST/subscribe?u=YOUR_U&id=YOUR_FORM_ID'); const res = await mailchimpSubscription.subscribe({ FOO: 'bar' }); // the response type { message?: string; status: SubscribeStatus }