feat(plugins): Adds Mailchimp newsletter subscription

This commit is contained in:
Oliver Windall Juhl authored and GitHub committed 2020-10-01 12:30:11 +02:00
1 parent 47e2ad2952
commit 89c21f2f5b
17 files changed
+5952

No files matched your search

@@ -0,0 +1,27 @@
# medusa-plugin-mailchimp
Mailchimp plugin for Medusa that supports newsletter subscriptions.
## Plugin Options
```
{
api_key: [your mailchimp api key] (required),
newsletter_list_id: ["123456789"] (required)
}
```
## Dynamic usage
You can resolve the Mailchimp service, such that your server can handle newsletter subscriptions.
Example:
```js
const mailchimpService = req.scope.resolve("mailchimpService")
mailchimpService.subscribeNewsletter(
"acme@mail.com",
// merge_fields to include in the subscription
{ FIRSTNAME: "Acme", LASTNAME: "Inc." }
)
```