The Mailchimp API taps into the heart of your email marketing efforts, allowing you to manage subscribers, campaigns, and reports. With the API, you can automate tasks like syncing subscriber lists, segmenting contacts based on behavior, and personalizing email content to match user profiles. It's a powerful tool for marketers looking to fine-tune their email strategy and maximize engagement.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
mailchimp: {
type: "app",
app: "mailchimp",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://login.mailchimp.com/oauth2/metadata`,
headers: {
Authorization: `Bearer ${this.mailchimp.$auth.oauth_access_token}`,
},
})
},
})
Sync New Users to Mailchimp List: Automatically add new users from your app (e.g., a SaaS platform) to a designated Mailchimp list once they sign up. This keeps your subscriber list up-to-date without manual input.
Dynamic Content Campaigns: Trigger an email campaign in Mailchimp when a user performs a specific action on your website (like browsing a product page). Using Pipedream's workflow, you can fetch user data and send personalized content that matches their interests.
E-commerce Follow-ups: For an online store, set up a workflow that sends a follow-up email through Mailchimp after a customer makes a purchase. Integrate with Shopify to pull in the purchase data and tailor the follow-up message, suggesting related products or asking for reviews.
Emit new event when a recipient clicks a pre-specified link in an specific campaign.
Emit new event when an audience is added to the connected Mailchimp account.
Emit new event when a new file is added to the File Manager of the connected Mailchimp account.
Adds a new note to an existing subscriber. See docs here
Adds a new subscriber to an audience or updates existing subscriber. See docs here
Adds an email address to a tag within an audience. See docs here
Mailchimp uses OAuth authentication. When you connect your Mailchimp account, Pipedream will open a popup window where you can sign into Mailchimp and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Mailchimp API.
Pipedream requests the following authorization scopes when you connect your account:
GET
https://login.mailchimp.com/oauth2/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://login.mailchimp.com/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}