@matimo/mailchimp 0.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tallclub
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,294 @@
1
+ # @matimo/mailchimp — Mailchimp Tools for Matimo
2
+
3
+ Mailchimp email marketing integration tools for Matimo's universal AI tools ecosystem. Manage audiences, subscribers, and campaigns through YAML-defined tools that work with any AI framework.
4
+
5
+ ## 📦 Installation
6
+
7
+ ```bash
8
+ npm install @matimo/mailchimp
9
+ # or
10
+ pnpm add @matimo/mailchimp
11
+ ```
12
+
13
+ ## 🛠️ Available Tools (7 Total)
14
+
15
+ | Category | Tool | Method | Description |
16
+ |----------|------|--------|-------------|
17
+ | **Audiences** | `mailchimp-get-lists` | GET | Get all audiences/lists |
18
+ | **Subscribers** | `mailchimp-add-list-member` | POST | Subscribe a contact to an audience |
19
+ | **Subscribers** | `mailchimp-get-list-members` | GET | Get subscribers with filters and pagination |
20
+ | **Subscribers** | `mailchimp-update-list-member` | PATCH | Update subscriber info or status |
21
+ | **Subscribers** | `mailchimp-remove-list-member` | DELETE | Remove subscriber (🔒 requires approval) |
22
+ | **Campaigns** | `mailchimp-create-campaign` | POST | Create an email campaign |
23
+ | **Campaigns** | `mailchimp-send-campaign` | POST | Send a campaign (🔒 requires approval) |
24
+
25
+ ## 🚀 Quick Start
26
+
27
+ ```typescript
28
+ import { MatimoInstance } from 'matimo';
29
+
30
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
31
+
32
+ // Get all audiences
33
+ const audiences = await matimo.execute('mailchimp-get-lists', {
34
+ server_prefix: 'us6',
35
+ count: 10,
36
+ });
37
+
38
+ // Add a subscriber
39
+ await matimo.execute('mailchimp-add-list-member', {
40
+ server_prefix: 'us6',
41
+ list_id: 'your_list_id',
42
+ email_address: 'jane@example.com',
43
+ status: 'subscribed',
44
+ merge_fields: { FNAME: 'Jane', LNAME: 'Doe' },
45
+ });
46
+ ```
47
+
48
+ ## 🔐 Authentication
49
+
50
+ Mailchimp Marketing API v3 uses **API key authentication**.
51
+
52
+ ### Step 1: Get Your API Key
53
+
54
+ 1. Log in to your Mailchimp account
55
+ 2. Navigate to **Account → Extras → API Keys**
56
+ 3. Click **Create A Key**
57
+ 4. Copy the generated key (format: `abc123def456-us6`)
58
+
59
+ ### Step 2: Find Your Server Prefix
60
+
61
+ Your server prefix is the suffix on your API key after the dash.
62
+
63
+ ```
64
+ API Key: abc123def456-us6
65
+
66
+ server_prefix = "us6"
67
+ ```
68
+
69
+ ### Step 3: Set Environment Variables
70
+
71
+ ```bash
72
+ export MAILCHIMP_API_KEY="abc123def456-us6"
73
+ ```
74
+
75
+ ### Step 4: Use in Tool Calls
76
+
77
+ Pass `server_prefix` as a parameter to every tool call:
78
+
79
+ ```typescript
80
+ await matimo.execute('mailchimp-get-lists', {
81
+ server_prefix: 'us6', // ← your data center prefix
82
+ });
83
+ ```
84
+
85
+ ## 📚 Integration Examples
86
+
87
+ ### Factory Pattern
88
+
89
+ ```typescript
90
+ import 'dotenv/config';
91
+ import { MatimoInstance } from 'matimo';
92
+
93
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
94
+ const SERVER = process.env.MAILCHIMP_SERVER_PREFIX || 'us6';
95
+
96
+ // List audiences
97
+ const result = await matimo.execute('mailchimp-get-lists', {
98
+ server_prefix: SERVER,
99
+ count: 10,
100
+ });
101
+ console.info('Audiences:', result.data.lists.map(l => l.name));
102
+
103
+ // Add subscriber
104
+ await matimo.execute('mailchimp-add-list-member', {
105
+ server_prefix: SERVER,
106
+ list_id: 'abc123def4',
107
+ email_address: 'newuser@example.com',
108
+ status: 'subscribed',
109
+ merge_fields: { FNAME: 'New', LNAME: 'User' },
110
+ });
111
+ ```
112
+
113
+ ### Decorator Pattern
114
+
115
+ ```typescript
116
+ import { MatimoInstance, tool, setGlobalMatimoInstance } from 'matimo';
117
+
118
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
119
+ setGlobalMatimoInstance(matimo);
120
+
121
+ class MailchimpAgent {
122
+ @tool('mailchimp-get-lists')
123
+ async getLists(server_prefix: string, count?: number): Promise<unknown> {
124
+ return undefined;
125
+ }
126
+
127
+ @tool('mailchimp-add-list-member')
128
+ async addSubscriber(
129
+ server_prefix: string,
130
+ list_id: string,
131
+ email_address: string,
132
+ status: string
133
+ ): Promise<unknown> {
134
+ return undefined;
135
+ }
136
+ }
137
+
138
+ const agent = new MailchimpAgent();
139
+ const lists = await agent.getLists('us6', 10);
140
+ ```
141
+
142
+ ### With LangChain
143
+
144
+ ```typescript
145
+ import { MatimoInstance, convertToolsToLangChain } from 'matimo';
146
+ import { ChatOpenAI } from '@langchain/openai';
147
+ import { createAgent } from 'langchain';
148
+
149
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
150
+
151
+ // Filter and convert Mailchimp tools for LangChain
152
+ const mailchimpTools = matimo
153
+ .listTools()
154
+ .filter(t => t.name.startsWith('mailchimp-'));
155
+
156
+ const langchainTools = convertToolsToLangChain(mailchimpTools, matimo);
157
+
158
+ const llm = new ChatOpenAI({ model: 'gpt-4o-mini' });
159
+ const agent = await createAgent({ llm, tools: langchainTools });
160
+
161
+ // Agent can now use Mailchimp tools autonomously
162
+ await agent.invoke({
163
+ input: 'Subscribe john@example.com to the main newsletter list'
164
+ });
165
+ ```
166
+
167
+ ## 🔧 API Reference
168
+
169
+ ### mailchimp-get-lists
170
+
171
+ | Parameter | Type | Required | Description |
172
+ |-----------|------|----------|-------------|
173
+ | `server_prefix` | string | ✅ Yes | Data center prefix (e.g., `us6`) |
174
+ | `count` | number | No | Results per page (default: 10, max: 1000) |
175
+ | `offset` | number | No | Records to skip for pagination (default: 0) |
176
+
177
+ ### mailchimp-add-list-member
178
+
179
+ | Parameter | Type | Required | Description |
180
+ |-----------|------|----------|-------------|
181
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
182
+ | `list_id` | string | ✅ Yes | Audience/list ID |
183
+ | `email_address` | string | ✅ Yes | Subscriber email address |
184
+ | `status` | string | ✅ Yes | `subscribed`, `unsubscribed`, `pending`, or `cleaned` |
185
+ | `merge_fields` | object | No | Merge fields like `{"FNAME": "Jane", "LNAME": "Doe"}` |
186
+ | `tags` | array | No | Array of tag name strings |
187
+
188
+ ### mailchimp-get-list-members
189
+
190
+ | Parameter | Type | Required | Description |
191
+ |-----------|------|----------|-------------|
192
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
193
+ | `list_id` | string | ✅ Yes | Audience/list ID |
194
+ | `status` | string | No | Filter by status: `subscribed`, `unsubscribed`, `pending`, `cleaned` |
195
+ | `count` | number | No | Results per page (default: 10, max: 1000) |
196
+ | `offset` | number | No | Records to skip |
197
+
198
+ ### mailchimp-update-list-member
199
+
200
+ | Parameter | Type | Required | Description |
201
+ |-----------|------|----------|-------------|
202
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
203
+ | `list_id` | string | ✅ Yes | Audience/list ID |
204
+ | `subscriber_hash` | string | ✅ Yes | MD5 hash of the lowercase email address |
205
+ | `status` | string | No | New subscription status |
206
+ | `email_address` | string | No | New email address |
207
+ | `merge_fields` | object | No | Merge fields to update |
208
+
209
+ ### mailchimp-remove-list-member ⚠️ Requires Approval
210
+
211
+ | Parameter | Type | Required | Description |
212
+ |-----------|------|----------|-------------|
213
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
214
+ | `list_id` | string | ✅ Yes | Audience/list ID |
215
+ | `subscriber_hash` | string | ✅ Yes | MD5 hash of the lowercase email address |
216
+
217
+ ### mailchimp-create-campaign
218
+
219
+ | Parameter | Type | Required | Description |
220
+ |-----------|------|----------|-------------|
221
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
222
+ | `type` | string | ✅ Yes | `regular`, `plaintext`, `rss`, or `variate` |
223
+ | `list_id` | string | No | Audience/list ID to send to |
224
+ | `subject_line` | string | No | Campaign subject line |
225
+ | `preview_text` | string | No | Preview text for email clients |
226
+ | `title` | string | No | Internal campaign title |
227
+ | `from_name` | string | No | Sender display name |
228
+ | `reply_to` | string | No | Reply-to email address |
229
+
230
+ ### mailchimp-send-campaign ⚠️ Requires Approval
231
+
232
+ | Parameter | Type | Required | Description |
233
+ |-----------|------|----------|-------------|
234
+ | `server_prefix` | string | ✅ Yes | Data center prefix |
235
+ | `campaign_id` | string | ✅ Yes | Campaign ID from `mailchimp-create-campaign` |
236
+
237
+ ## 💡 Tips
238
+
239
+ ### Finding the Subscriber Hash
240
+
241
+ The `subscriber_hash` is the MD5 hash of the lowercase email address:
242
+
243
+ ```javascript
244
+ import { createHash } from 'crypto';
245
+ const email = 'jane@example.com';
246
+ const hash = createHash('md5').update(email.toLowerCase()).digest('hex');
247
+ // Use hash as subscriber_hash
248
+ ```
249
+
250
+ ### Rate Limits
251
+
252
+ - Mailchimp Marketing API: 10 requests per second per account
253
+ - Some batch operations count as multiple requests
254
+ - Implement appropriate delays in high-volume scenarios
255
+
256
+ ### Pagination
257
+
258
+ For large audiences, paginate through results:
259
+
260
+ ```typescript
261
+ let offset = 0;
262
+ const count = 100;
263
+ let allMembers = [];
264
+
265
+ while (true) {
266
+ const result = await matimo.execute('mailchimp-get-list-members', {
267
+ server_prefix: 'us6',
268
+ list_id: 'abc123',
269
+ count,
270
+ offset,
271
+ });
272
+ allMembers.push(...result.data.members);
273
+ if (result.data.members.length < count) break;
274
+ offset += count;
275
+ }
276
+ ```
277
+
278
+ ## 🐛 Troubleshooting
279
+
280
+ | Error | Cause | Solution |
281
+ |-------|-------|----------|
282
+ | `404 Resource Not Found` | Wrong `list_id` or `subscriber_hash` | Verify IDs from Mailchimp dashboard |
283
+ | `400 Invalid Resource` | Malformed request body | Check parameter types and required fields |
284
+ | `401 Unauthorized` | Invalid or expired API key | Regenerate API key at Mailchimp account settings |
285
+ | `403 Forbidden` | Insufficient permissions | Check API key permissions |
286
+ | `429 Too Many Requests` | Rate limit exceeded | Implement delays between requests |
287
+
288
+ ## 🤝 Contributing
289
+
290
+ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines on contributing to Matimo.
291
+
292
+ ---
293
+
294
+ Part of the [Matimo](https://github.com/tallclub/matimo) ecosystem — Write YAML once, use everywhere.
@@ -0,0 +1,15 @@
1
+ <svg width="38" height="40" viewBox="0 0 38 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0)">
3
+ <path d="M35.4564 23.7461C35.7634 23.9117 36.0345 24.1365 36.2539 24.4075C36.595 24.8245 37 25.5651 37 26.7228C37 28.3318 36.3816 30.045 36.1932 30.5305C36.1885 30.5398 36.1807 30.5491 36.1807 30.56C35.0954 33.1717 33.1998 35.3665 30.7727 36.8215C28.4004 38.2453 25.5204 39 22.4457 39H21.874C18.989 38.9399 16.1728 38.1087 13.7183 36.5928C11.5573 35.2377 9.80917 33.317 8.66388 31.0393C7.34228 30.8341 6.10864 30.2504 5.11251 29.3588C3.83683 28.2291 3.04712 26.7509 2.89136 25.1948C2.80667 24.4079 2.85245 23.6125 3.02687 22.8405L2.48482 22.3815C1.61255 21.6455 1.10321 20.5858 1.01443 19.341C0.941223 18.3047 1.14683 17.1221 1.62502 15.815C2.74183 12.7714 5.30566 9.14581 8.48631 6.11775C9.90595 4.74017 11.4809 3.53186 13.1794 2.51708C14.9302 1.50721 16.5189 0.995269 17.9021 1.00149C18.9853 0.973166 20.0403 1.3487 20.8616 2.05493C20.9071 2.08828 21.5749 2.74181 22.1033 3.2589L22.145 3.29976L22.3771 3.20173C24.131 2.47506 25.8568 2.09228 27.3693 2.09228C30.5561 2.09228 32.6215 3.80392 32.6215 6.44919C32.6215 8.08148 31.8225 9.91138 30.3443 11.6853C30.7474 12.3092 31.0516 12.9915 31.2462 13.7081C31.4562 14.4388 31.5709 15.1935 31.5873 15.9535C31.6029 16.2803 31.6169 16.8015 31.6293 17.2683C32.6044 17.5578 33.8287 18.0464 34.5639 18.8244C35.1335 19.3887 35.5069 20.1206 35.6293 20.9126C35.7507 21.6931 35.6295 22.492 35.282 23.2015C35.3131 23.2902 35.3505 23.4007 35.3785 23.4894C35.4066 23.5781 35.433 23.6637 35.4564 23.7461Z" fill="#001D28"/>
4
+ <path d="M8.446 20.7569C8.16153 20.7416 7.87628 20.762 7.59683 20.8174C5.57352 21.2268 4.43041 22.9461 4.6574 25.1942C4.85989 27.2229 6.9077 28.934 8.802 28.9848C8.99665 28.9901 9.19135 28.9764 9.38336 28.9438C11.4312 28.5934 11.9701 26.3617 11.632 24.1676C11.2499 21.6918 9.57932 20.8191 8.446 20.7569ZM10.4514 26.6237C10.3683 26.7584 10.2494 26.8672 10.1081 26.9378C9.96668 27.0084 9.80843 27.038 9.65117 27.0232C9.21352 26.9888 8.72525 26.6695 8.6583 25.877C8.65371 25.4926 8.72416 25.111 8.86569 24.7537C8.95434 24.5298 8.96344 24.2821 8.89148 24.0522C8.81952 23.8223 8.67087 23.6243 8.4705 23.4913C8.35128 23.4129 8.21769 23.359 8.07751 23.3329C7.93733 23.3067 7.79336 23.3088 7.65399 23.339C7.51755 23.3679 7.38822 23.4238 7.27354 23.5034C7.15887 23.5829 7.06115 23.6846 6.98608 23.8024C6.88071 23.9835 6.79842 24.1771 6.74113 24.3788C6.73133 24.4148 6.72153 24.4426 6.715 24.4607C6.62192 24.7112 6.47331 24.7881 6.3737 24.7701C6.32634 24.7701 6.26102 24.7325 6.21856 24.6178C6.10915 24.3002 6.2055 23.4144 6.79012 22.7594C6.98319 22.5527 7.22241 22.3949 7.48813 22.299C7.75385 22.2031 8.03848 22.1718 8.31863 22.2076C8.61521 22.248 8.89714 22.3616 9.13913 22.5382C9.38111 22.7148 9.57557 22.9489 9.70506 23.2195C10.1068 23.9858 9.74915 24.7898 9.54176 25.2712L9.4797 25.4136C9.3458 25.7329 9.33926 26.0113 9.46011 26.1979C9.511 26.2713 9.57929 26.3308 9.65882 26.3711C9.73835 26.4114 9.82664 26.4312 9.91572 26.4288C9.9996 26.4283 10.0831 26.4167 10.1639 26.3944C10.2685 26.3699 10.3779 26.3437 10.4448 26.4272C10.467 26.4548 10.4796 26.4889 10.4808 26.5243C10.4819 26.5597 10.4716 26.5946 10.4514 26.6237Z" fill="#EFEEEA"/>
5
+ <path d="M36.9567 24.6372C36.7266 24.352 36.4424 24.1155 36.1206 23.9413C36.0961 23.8545 36.0683 23.7644 36.0389 23.6711C36.0095 23.5778 35.9703 23.4615 35.9377 23.3682C36.302 22.6216 36.4292 21.7809 36.3018 20.9596C36.1736 20.1262 35.782 19.356 35.1849 18.7622C34.4141 17.9435 33.1305 17.4293 32.1082 17.1248C32.0952 16.6336 32.0805 16.085 32.0642 15.7412C32.0469 14.9414 31.9267 14.1473 31.7065 13.3784C31.5025 12.6243 31.1836 11.9063 30.761 11.2498C32.3107 9.38317 33.1485 7.45759 33.1485 5.73996C33.1485 2.95638 30.9831 1.15525 27.6419 1.15525C26.0563 1.15525 24.2469 1.55805 22.4081 2.32271L22.1648 2.42587C21.6047 1.8757 20.8682 1.15197 20.8192 1.11595C19.9582 0.37279 18.8521 -0.0223774 17.7164 0.00743079C16.2663 0.0008812 14.6006 0.539585 12.7651 1.60226C10.9843 2.6701 9.33319 3.94159 7.84482 5.3912C4.51019 8.57757 1.82224 12.3927 0.651367 15.5955C0.15003 16.9709 -0.0655288 18.2153 0.0112231 19.3058C0.104305 20.6157 0.638303 21.7308 1.55279 22.5053L2.12109 22.9883C1.93823 23.8007 1.89023 24.6377 1.97901 25.4657C2.14231 27.1031 2.97026 28.6586 4.3077 29.8474C5.35205 30.7856 6.64541 31.3999 8.03099 31.6158C9.23173 34.0126 11.0645 36.0337 13.3301 37.4596C15.9034 39.0548 18.856 39.9295 21.8806 39.9927C22.0799 39.9927 22.2807 39.9927 22.48 39.9927C25.7035 39.9927 28.723 39.1986 31.2101 37.7003C33.7547 36.1692 35.7421 33.8596 36.8799 31.1115C36.8799 31.1 36.8881 31.0902 36.893 31.0803C37.0906 30.5695 37.7389 28.7667 37.7389 27.0736C37.7389 25.8554 37.3143 25.076 36.9567 24.6372ZM35.6699 30.6088C33.462 35.9123 28.1939 38.8645 21.9198 38.6779C16.0703 38.5027 11.0815 35.4031 8.89812 30.3632C7.57701 30.3632 6.2167 29.7819 5.18137 28.8633C4.09214 27.894 3.4275 26.6414 3.2887 25.3331C3.18324 24.3913 3.29958 23.4379 3.62836 22.5495L2.4036 21.5081C-3.20746 16.7597 14.341 -2.80234 19.9553 2.10658L21.8692 3.98795C21.8692 3.98795 22.9062 3.54585 22.9127 3.54257C27.8346 1.49255 31.8306 2.4799 31.8421 5.7416C31.8421 7.43794 30.7659 9.41428 29.0398 11.2089C29.6652 11.7918 30.1666 12.7022 30.454 13.7419C30.6444 14.4085 30.7476 15.0971 30.761 15.7903C30.7904 16.4813 30.8231 18.0827 30.8263 18.1203L31.5204 18.3135C32.8415 18.6852 33.7821 19.1797 34.241 19.6644C34.6542 20.0673 34.9248 20.5946 35.0118 21.1659C35.0901 21.6096 35.0787 22.3923 34.4957 23.2667C34.6067 23.5288 34.7021 23.7972 34.7815 24.0706C34.9268 24.5373 35.0313 24.9254 35.0477 24.9827C35.5817 24.9827 36.421 25.6 36.421 27.0867C36.421 28.5735 35.8136 30.2371 35.6699 30.6088Z" fill="#EFEEEA"/>
6
+ <path d="M34.7814 26.1871C34.5928 26.0813 34.3747 26.041 34.1609 26.0725C34.0471 25.3765 33.848 24.6973 33.5681 24.0503C32.2731 25.0753 30.6042 25.7974 29.3353 26.1625C27.4962 26.6805 25.5839 26.888 23.6769 26.7766C22.4489 26.6767 21.6372 26.3164 21.3319 27.312C24.1358 28.3419 27.1046 27.9014 27.1046 27.9014C27.1182 27.8999 27.1321 27.901 27.1453 27.9049C27.1585 27.9088 27.1707 27.9152 27.1814 27.9239C27.192 27.9326 27.2009 27.9434 27.2073 27.9556C27.2137 27.9677 27.2177 27.9811 27.2189 27.9948C27.2213 28.0177 27.2164 28.0408 27.205 28.0608C27.1936 28.0808 27.1762 28.0966 27.1552 28.1061C27.1552 28.1061 24.869 29.1688 21.2519 28.0455C21.3531 28.897 22.181 29.2785 22.5762 29.4324C22.9147 29.5589 23.264 29.6542 23.6197 29.7173C28.1073 30.4918 32.3041 27.9162 33.2545 27.2711C33.3248 27.2219 33.3721 27.2711 33.315 27.3546C33.2872 27.4006 33.2566 27.4449 33.2235 27.4872C32.0673 28.9821 28.9581 30.7145 24.9147 30.7129C23.1511 30.7129 21.389 30.0907 20.7407 29.1328C19.7364 27.6477 20.6917 25.4797 22.3639 25.7057L23.0972 25.7876C25.1891 26.0217 28.2167 25.7286 30.7119 24.5661C32.9982 23.5034 33.8571 22.3343 33.7281 21.3879C33.6846 21.0941 33.5464 20.8227 33.3346 20.615C32.9247 20.2122 32.2731 19.8978 31.1757 19.59C30.8132 19.4869 30.5666 19.4263 30.3021 19.3346C29.8317 19.1708 29.5982 19.0529 29.546 18.1655C29.5231 17.7774 29.4545 16.4233 29.43 15.8633C29.3876 14.8809 29.2667 13.5447 28.4404 12.9913C28.227 12.854 27.9802 12.7782 27.7268 12.7719C27.5856 12.7636 27.444 12.7774 27.3071 12.8128C26.8335 12.8931 26.5543 13.1403 26.2048 13.4383C25.1711 14.3012 24.2974 14.4437 23.3258 14.4011C22.7461 14.3765 22.1321 14.2865 21.4266 14.2374L21.0151 14.2144C19.382 14.1309 17.6445 15.5391 17.3538 17.5384C16.9505 20.3219 18.9607 21.7612 19.5421 22.6045C19.6325 22.7117 19.6893 22.8432 19.7054 22.9827C19.69 23.1377 19.6158 23.2807 19.498 23.3822C17.8388 25.0933 17.3081 27.8114 17.9336 30.0759C18.0098 30.3562 18.1081 30.6299 18.2275 30.8946C19.6972 34.3331 24.2452 35.9329 28.6919 34.4756C29.2711 34.2822 29.8331 34.0406 30.3723 33.7535C31.3449 33.2703 32.2214 32.6133 32.959 31.8148C34.1033 30.6657 34.857 29.184 35.1129 27.5805C35.2501 26.6898 35.0541 26.3508 34.7814 26.1871ZM28.7948 20.4955C28.7948 20.8623 28.5678 21.1505 28.3049 21.1505C28.0419 21.1505 27.828 20.8443 27.8329 20.4775C27.8378 20.1107 28.0615 19.8225 28.3228 19.8225C28.5841 19.8225 28.8078 20.1304 28.8013 20.4955H28.7948ZM27.5798 16.1646C28.0991 16.0811 28.349 16.6181 28.5351 17.5089C28.6592 18.1065 28.6347 18.6551 28.4976 18.9744C28.2412 18.9408 27.9815 18.9408 27.7251 18.9744C27.477 18.6176 27.3098 18.2108 27.2352 17.7823C27.0425 16.8932 27.0621 16.2481 27.5798 16.1646ZM25.8406 20.9458C25.9582 20.7051 26.3191 20.6412 26.6474 20.8033C26.9756 20.9654 27.1471 21.2945 27.0295 21.5303C26.9119 21.7661 26.5494 21.8333 26.2228 21.6711C25.8962 21.509 25.7231 21.1848 25.8406 20.9458ZM23.8092 20.6756C23.7553 20.7591 23.6459 20.7444 23.3976 20.7165C22.874 20.6372 22.3388 20.6936 21.843 20.8803C21.73 20.9277 21.6115 20.9607 21.4903 20.9785C21.461 20.9782 21.4328 20.9678 21.4103 20.9491C21.3981 20.9379 21.3886 20.9242 21.3824 20.9089C21.3762 20.8936 21.3734 20.8771 21.3743 20.8606C21.4019 20.7118 21.4863 20.5796 21.6095 20.4922C21.8717 20.2764 22.1914 20.1426 22.5289 20.1074C23.1951 20.0272 23.6818 20.3383 23.7961 20.5233C23.8133 20.5445 23.8237 20.5703 23.826 20.5975C23.8283 20.6246 23.8225 20.6518 23.8092 20.6756ZM20.0989 19.7587C20.0124 19.7456 19.9748 19.7079 19.9634 19.6588C19.9307 19.5065 20.1659 19.2527 20.4141 19.071C20.7761 18.8054 21.2001 18.6377 21.6454 18.5841C22.0908 18.5305 22.5423 18.5927 22.9567 18.7648C23.3438 18.9253 23.6766 19.1942 23.9153 19.5393C24.0035 19.6833 24.0198 19.7963 23.9627 19.8553C23.8745 19.9502 23.6459 19.8422 23.2752 19.6784C22.8298 19.4588 22.3374 19.3525 21.8414 19.369C21.0183 19.4197 20.3031 19.7816 20.0989 19.7587Z" fill="#EFEEEA"/>
7
+ <path d="M25.7473 9.65984C25.8191 9.67622 25.8649 9.55341 25.8012 9.51739C24.7469 8.96866 23.5836 8.66321 22.3963 8.62337C22.3848 8.62329 22.3735 8.62 22.3638 8.61386C22.354 8.60772 22.3461 8.59898 22.3411 8.58861C22.336 8.57824 22.3339 8.56666 22.335 8.55515C22.3361 8.54365 22.3404 8.53269 22.3473 8.52349C22.5326 8.28205 22.7483 8.06575 22.9891 7.87999C22.9998 7.8713 23.0074 7.85946 23.011 7.84616C23.0146 7.83286 23.0139 7.81876 23.009 7.80589C23.0041 7.79301 22.9953 7.78201 22.9838 7.77444C22.9723 7.76687 22.9588 7.76313 22.945 7.76374C21.49 7.85379 19.8292 8.55296 18.8739 9.20628C18.8635 9.21332 18.8511 9.21701 18.8386 9.21686C18.826 9.21671 18.8138 9.21273 18.8035 9.20545C18.7932 9.19817 18.7854 9.18793 18.781 9.17609C18.7767 9.16425 18.7761 9.15137 18.7792 9.13915C18.8772 8.77135 19.0215 8.41756 19.2087 8.0863C19.215 8.07498 19.2174 8.06193 19.2158 8.04909C19.2141 8.03624 19.2084 8.02427 19.1994 8.01493C19.1905 8.00558 19.1788 7.99936 19.166 7.99718C19.1533 7.995 19.1402 7.99697 19.1287 8.0028C17.5936 8.79038 15.8822 10.1904 14.4909 11.8032C14.4812 11.8151 14.4762 11.83 14.4766 11.8453C14.477 11.8606 14.4829 11.8753 14.4932 11.8866C14.5035 11.8979 14.5175 11.9051 14.5327 11.9069C14.5478 11.9088 14.5631 11.9051 14.5758 11.8965C15.7761 11.0189 17.4238 10.2051 19.581 9.67785C21.609 9.2073 23.7166 9.20114 25.7473 9.65984Z" fill="#EFEEEA"/>
8
+ <path d="M20.5548 4.67148C20.5548 4.67148 19.0263 2.8949 18.5658 2.76391C15.7276 1.99597 9.5989 6.23355 5.68618 11.8335C4.10379 14.098 1.83715 18.1112 2.91985 20.1744C3.05375 20.4298 3.80984 21.0864 4.21483 21.427C4.94219 20.4084 6.03506 19.7123 7.26368 19.485C8.86731 15.1607 11.5438 11.185 15.0875 8.44895C16.8025 7.04018 18.6312 5.77667 20.5548 4.67148Z" fill="#EFEEEA"/>
9
+ </g>
10
+ <defs>
11
+ <clipPath id="clip0">
12
+ <rect width="38" height="40" fill="white"/>
13
+ </clipPath>
14
+ </defs>
15
+ </svg>
@@ -0,0 +1,50 @@
1
+ # Mailchimp Provider Definition
2
+ #
3
+ # This file defines provider metadata for Mailchimp.
4
+ # Mailchimp Marketing API v3 accepts API key auth via the Authorization header.
5
+ #
6
+ # Setup:
7
+ # 1. Log in to Mailchimp → Account → Extras → API Keys
8
+ # 2. Generate a new API key
9
+ # 3. Note your server prefix (last part of the API key, e.g. "us6" from "abc123-us6")
10
+ # 4. Set MAILCHIMP_API_KEY environment variable to your full API key
11
+ # 5. Pass server_prefix as a parameter to each tool call
12
+
13
+ name: mailchimp-provider
14
+ type: provider
15
+ version: '1.0.0'
16
+ tags:
17
+ - Email Marketing
18
+ - Audiences
19
+ - Campaigns
20
+ - Marketing Automation
21
+
22
+ description: |
23
+ Mailchimp Marketing API v3 Provider Configuration
24
+
25
+ All Mailchimp tools use API key authentication via the Authorization header.
26
+ Format: Authorization: apikey YOUR_API_KEY
27
+
28
+ Authentication:
29
+ - API Key found at: https://us1.admin.mailchimp.com/account/api/
30
+ - Set MAILCHIMP_API_KEY environment variable to your full API key
31
+ - Server prefix is the datacenter suffix on your API key (e.g. "us6" from "abc123-us6")
32
+
33
+ provider:
34
+ name: mailchimp
35
+ displayName: Mailchimp
36
+
37
+ # Mailchimp uses API key auth via Authorization header (apikey <key>)
38
+ authType: api_key
39
+
40
+ # Additional metadata
41
+ documentation: https://mailchimp.com/developer/marketing/api/
42
+ learnMore: https://mailchimp.com/developer/marketing/guides/quick-start/
43
+
44
+ # UI assets and branding
45
+ assets:
46
+ icon: assets/mc-logo.svg
47
+ logo: assets/mc-logo.svg
48
+ brand_color: '#FFE01B'
49
+ homepage: 'https://mailchimp.com'
50
+ alt: 'Mailchimp'
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@matimo/mailchimp",
3
+ "version": "0.1.0-alpha.11",
4
+ "description": "Mailchimp email marketing tools for Matimo — manage audiences, subscribers, and campaigns",
5
+ "type": "module",
6
+ "files": [
7
+ "tools",
8
+ "README.md",
9
+ "definition.yaml",
10
+ "assets"
11
+ ],
12
+ "peerDependencies": {
13
+ "matimo": "0.1.0-alpha.11"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "^5.9.3",
17
+ "@matimo/core": "0.1.0-alpha.11"
18
+ }
19
+ }
@@ -0,0 +1,117 @@
1
+ name: mailchimp-add-list-member
2
+ version: '1.0.0'
3
+ description: >
4
+ Add a new subscriber to a Mailchimp audience (list). Use this to subscribe
5
+ a contact to receive email campaigns. Supports setting merge fields (first name, last name)
6
+ and tags for segmentation.
7
+
8
+ parameters:
9
+ server_prefix:
10
+ type: string
11
+ required: true
12
+ description: >
13
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
14
+ "abc123-us6" → server_prefix is "us6".
15
+ list_id:
16
+ type: string
17
+ required: true
18
+ description: The unique ID of the Mailchimp audience/list to add the member to
19
+ email_address:
20
+ type: string
21
+ required: true
22
+ description: The email address of the subscriber to add
23
+ status:
24
+ type: string
25
+ required: true
26
+ description: >
27
+ Subscriber status: "subscribed" (opted in), "unsubscribed" (opted out),
28
+ "pending" (requires email confirmation), or "cleaned" (invalid email)
29
+ enum:
30
+ - subscribed
31
+ - unsubscribed
32
+ - pending
33
+ - cleaned
34
+ merge_fields:
35
+ type: object
36
+ required: false
37
+ description: >
38
+ Key-value pairs for merge fields such as FNAME (first name) and LNAME (last name).
39
+ Example: {"FNAME": "Jane", "LNAME": "Doe"}
40
+ tags:
41
+ type: array
42
+ required: false
43
+ description: Array of tag names to apply to the subscriber for segmentation
44
+
45
+ execution:
46
+ type: http
47
+ method: POST
48
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/lists/{list_id}/members'
49
+ headers:
50
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
51
+ Content-Type: application/json
52
+ body:
53
+ email_address: '{email_address}'
54
+ status: '{status}'
55
+ merge_fields: '{merge_fields}'
56
+ tags: '{tags}'
57
+ timeout: 30000
58
+
59
+ authentication:
60
+ type: api_key
61
+ location: header
62
+ name: Authorization
63
+ notes:
64
+ env: MAILCHIMP_API_KEY
65
+
66
+ output_schema:
67
+ type: object
68
+ properties:
69
+ success:
70
+ type: boolean
71
+ data:
72
+ type: object
73
+ properties:
74
+ id:
75
+ type: string
76
+ description: MD5 hash of the subscriber email (subscriber_hash)
77
+ email_address:
78
+ type: string
79
+ status:
80
+ type: string
81
+ merge_fields:
82
+ type: object
83
+ tags:
84
+ type: array
85
+ list_id:
86
+ type: string
87
+ timestamp_opt:
88
+ type: string
89
+ timestamp_signup:
90
+ type: string
91
+
92
+ error_handling:
93
+ retry: 2
94
+ backoff_type: exponential
95
+ initial_delay_ms: 500
96
+
97
+ examples:
98
+ - name: 'Subscribe a new contact'
99
+ params:
100
+ server_prefix: us6
101
+ list_id: abc123def4
102
+ email_address: jane@example.com
103
+ status: subscribed
104
+ merge_fields:
105
+ FNAME: Jane
106
+ LNAME: Doe
107
+ expected_result: 'Returns the new member record with id (subscriber_hash) and status'
108
+ - name: 'Add pending subscriber with tags'
109
+ params:
110
+ server_prefix: us6
111
+ list_id: abc123def4
112
+ email_address: pending@example.com
113
+ status: pending
114
+ tags:
115
+ - newsletter
116
+ - vip
117
+ expected_result: 'Returns member record with pending status awaiting confirmation'
@@ -0,0 +1,125 @@
1
+ name: mailchimp-create-campaign
2
+ version: '1.0.0'
3
+ description: >
4
+ Create a new Mailchimp email campaign. Supports regular, plaintext, RSS,
5
+ and A/B test variate campaign types. After creating, configure the campaign
6
+ content and use mailchimp-send-campaign to send it.
7
+
8
+ parameters:
9
+ server_prefix:
10
+ type: string
11
+ required: true
12
+ description: >
13
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
14
+ "abc123-us6" → server_prefix is "us6".
15
+ type:
16
+ type: string
17
+ required: true
18
+ description: >
19
+ Campaign type: "regular" (standard email), "plaintext" (text-only email),
20
+ "rss" (RSS-driven campaign), or "variate" (A/B test campaign)
21
+ enum:
22
+ - regular
23
+ - plaintext
24
+ - rss
25
+ - variate
26
+ list_id:
27
+ type: string
28
+ required: false
29
+ description: >
30
+ The unique ID of the Mailchimp audience/list to send this campaign to.
31
+ Required when type is "regular" or "plaintext".
32
+ subject_line:
33
+ type: string
34
+ required: false
35
+ description: The subject line for the campaign email
36
+ preview_text:
37
+ type: string
38
+ required: false
39
+ description: Preview text displayed after the subject line in email clients (max 150 chars)
40
+ title:
41
+ type: string
42
+ required: false
43
+ description: Internal title for the campaign (used to identify it in Mailchimp dashboard)
44
+ from_name:
45
+ type: string
46
+ required: false
47
+ description: The "From" name subscribers will see in their inbox
48
+ reply_to:
49
+ type: string
50
+ required: false
51
+ description: The reply-to email address for the campaign
52
+
53
+ execution:
54
+ type: http
55
+ method: POST
56
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/campaigns'
57
+ headers:
58
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
59
+ Content-Type: application/json
60
+ body:
61
+ type: '{type}'
62
+ recipients:
63
+ list_id: '{list_id}'
64
+ settings:
65
+ subject_line: '{subject_line}'
66
+ preview_text: '{preview_text}'
67
+ title: '{title}'
68
+ from_name: '{from_name}'
69
+ reply_to: '{reply_to}'
70
+ timeout: 30000
71
+
72
+ authentication:
73
+ type: api_key
74
+ location: header
75
+ name: Authorization
76
+ notes:
77
+ env: MAILCHIMP_API_KEY
78
+
79
+ output_schema:
80
+ type: object
81
+ properties:
82
+ success:
83
+ type: boolean
84
+ data:
85
+ type: object
86
+ properties:
87
+ id:
88
+ type: string
89
+ description: Unique campaign ID (use this with mailchimp-send-campaign)
90
+ type:
91
+ type: string
92
+ status:
93
+ type: string
94
+ description: Campaign status (save, paused, schedule, sending, sent)
95
+ settings:
96
+ type: object
97
+ recipients:
98
+ type: object
99
+
100
+ error_handling:
101
+ retry: 2
102
+ backoff_type: exponential
103
+ initial_delay_ms: 500
104
+
105
+ examples:
106
+ - name: 'Create a regular campaign'
107
+ params:
108
+ server_prefix: us6
109
+ type: regular
110
+ list_id: abc123def4
111
+ subject_line: 'Welcome to our newsletter!'
112
+ preview_text: 'Check out what we have for you this month'
113
+ title: 'Monthly Newsletter - March 2026'
114
+ from_name: 'Acme Marketing'
115
+ reply_to: marketing@acme.com
116
+ expected_result: 'Returns campaign record with id for use in mailchimp-send-campaign'
117
+ - name: 'Create a plaintext campaign'
118
+ params:
119
+ server_prefix: us6
120
+ type: plaintext
121
+ list_id: abc123def4
122
+ subject_line: 'Quick update from us'
123
+ from_name: 'Acme Team'
124
+ reply_to: hello@acme.com
125
+ expected_result: 'Returns plaintext campaign record ready to add content and send'
@@ -0,0 +1,101 @@
1
+ name: mailchimp-get-list-members
2
+ version: '1.0.0'
3
+ description: >
4
+ Get all members (subscribers) from a Mailchimp audience/list with optional
5
+ filtering by subscription status and pagination support.
6
+
7
+ parameters:
8
+ server_prefix:
9
+ type: string
10
+ required: true
11
+ description: >
12
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
13
+ "abc123-us6" → server_prefix is "us6".
14
+ list_id:
15
+ type: string
16
+ required: true
17
+ description: The unique ID of the Mailchimp audience/list to get members from
18
+ status:
19
+ type: string
20
+ required: false
21
+ description: >
22
+ Filter members by subscription status. Options: "subscribed", "unsubscribed",
23
+ "pending", "cleaned", "transactional", "archived". Omit to get all members.
24
+ enum:
25
+ - subscribed
26
+ - unsubscribed
27
+ - pending
28
+ - cleaned
29
+ - transactional
30
+ - archived
31
+ count:
32
+ type: number
33
+ required: false
34
+ description: Number of members to return per page (default 10, max 1000)
35
+ default: 10
36
+ min: 1
37
+ max: 1000
38
+ offset:
39
+ type: number
40
+ required: false
41
+ description: Number of records to skip for pagination (default 0)
42
+ default: 0
43
+ min: 0
44
+
45
+ execution:
46
+ type: http
47
+ method: GET
48
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/lists/{list_id}/members'
49
+ headers:
50
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
51
+ Content-Type: application/json
52
+ query_params:
53
+ status: '{status}'
54
+ count: '{count}'
55
+ offset: '{offset}'
56
+ timeout: 30000
57
+
58
+ authentication:
59
+ type: api_key
60
+ location: header
61
+ name: Authorization
62
+ notes:
63
+ env: MAILCHIMP_API_KEY
64
+
65
+ output_schema:
66
+ type: object
67
+ properties:
68
+ success:
69
+ type: boolean
70
+ data:
71
+ type: object
72
+ properties:
73
+ members:
74
+ type: array
75
+ description: Array of member objects with email, status, and merge fields
76
+ list_id:
77
+ type: string
78
+ total_items:
79
+ type: number
80
+
81
+ error_handling:
82
+ retry: 2
83
+ backoff_type: exponential
84
+ initial_delay_ms: 500
85
+
86
+ examples:
87
+ - name: 'Get all subscribed members'
88
+ params:
89
+ server_prefix: us6
90
+ list_id: abc123def4
91
+ status: subscribed
92
+ count: 100
93
+ offset: 0
94
+ expected_result: 'Returns array of subscribed members with total_items count'
95
+ - name: 'Get first page of all members'
96
+ params:
97
+ server_prefix: us6
98
+ list_id: abc123def4
99
+ count: 10
100
+ offset: 0
101
+ expected_result: 'Returns first 10 members across all statuses'
@@ -0,0 +1,81 @@
1
+ name: mailchimp-get-lists
2
+ version: '1.0.0'
3
+ description: >
4
+ Get all Mailchimp audiences (lists) for the authenticated account.
5
+ Returns a paginated list of all audiences with subscriber counts and settings.
6
+
7
+ parameters:
8
+ server_prefix:
9
+ type: string
10
+ required: true
11
+ description: >
12
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
13
+ "abc123-us6" → server_prefix is "us6".
14
+ count:
15
+ type: number
16
+ required: false
17
+ description: Number of audiences to return (default 10, max 1000)
18
+ default: 10
19
+ min: 1
20
+ max: 1000
21
+ offset:
22
+ type: number
23
+ required: false
24
+ description: Number of records to skip for pagination (default 0)
25
+ default: 0
26
+ min: 0
27
+
28
+ execution:
29
+ type: http
30
+ method: GET
31
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/lists'
32
+ headers:
33
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
34
+ Content-Type: application/json
35
+ query_params:
36
+ count: '{count}'
37
+ offset: '{offset}'
38
+ timeout: 30000
39
+
40
+ authentication:
41
+ type: api_key
42
+ location: header
43
+ name: Authorization
44
+ notes:
45
+ env: MAILCHIMP_API_KEY
46
+
47
+ output_schema:
48
+ type: object
49
+ properties:
50
+ success:
51
+ type: boolean
52
+ data:
53
+ type: object
54
+ properties:
55
+ lists:
56
+ type: array
57
+ description: Array of audience objects
58
+ total_items:
59
+ type: number
60
+ description: Total number of audiences in the account
61
+ _links:
62
+ type: array
63
+
64
+ error_handling:
65
+ retry: 2
66
+ backoff_type: exponential
67
+ initial_delay_ms: 500
68
+
69
+ examples:
70
+ - name: 'Get first 10 audiences'
71
+ params:
72
+ server_prefix: us6
73
+ count: 10
74
+ offset: 0
75
+ expected_result: 'Returns a list of audiences with total_items count'
76
+ - name: 'Get next page of audiences'
77
+ params:
78
+ server_prefix: us6
79
+ count: 10
80
+ offset: 10
81
+ expected_result: 'Returns the second page of audiences'
@@ -0,0 +1,64 @@
1
+ name: mailchimp-remove-list-member
2
+ version: '1.0.0'
3
+ description: >
4
+ Archive (unsubscribe and remove) a subscriber from a Mailchimp audience/list.
5
+ This action archives the contact so they no longer appear as an active member.
6
+ Use the MD5 hash of the lowercase email address as the subscriber_hash.
7
+ ⚠️ This action requires approval — it cannot be undone from this tool.
8
+
9
+ requires_approval: true
10
+
11
+ parameters:
12
+ server_prefix:
13
+ type: string
14
+ required: true
15
+ description: >
16
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
17
+ "abc123-us6" → server_prefix is "us6".
18
+ list_id:
19
+ type: string
20
+ required: true
21
+ description: The unique ID of the Mailchimp audience/list the member belongs to
22
+ subscriber_hash:
23
+ type: string
24
+ required: true
25
+ description: >
26
+ The MD5 hash of the subscriber's lowercase email address. You can generate this
27
+ using MD5("email@example.com"). Use the id field from list member responses.
28
+
29
+ execution:
30
+ type: http
31
+ method: DELETE
32
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/lists/{list_id}/members/{subscriber_hash}'
33
+ headers:
34
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
35
+ Content-Type: application/json
36
+ timeout: 30000
37
+
38
+ authentication:
39
+ type: api_key
40
+ location: header
41
+ name: Authorization
42
+ notes:
43
+ env: MAILCHIMP_API_KEY
44
+
45
+ output_schema:
46
+ type: object
47
+ properties:
48
+ success:
49
+ type: boolean
50
+ statusCode:
51
+ type: number
52
+
53
+ error_handling:
54
+ retry: 1
55
+ backoff_type: linear
56
+ initial_delay_ms: 1000
57
+
58
+ examples:
59
+ - name: 'Remove a subscriber'
60
+ params:
61
+ server_prefix: us6
62
+ list_id: abc123def4
63
+ subscriber_hash: b775e3e869bc8eae5fcb23cdc5ec64ff
64
+ expected_result: 'Returns 204 No Content on success (success: true, statusCode: 204)'
@@ -0,0 +1,59 @@
1
+ name: mailchimp-send-campaign
2
+ version: '1.0.0'
3
+ description: >
4
+ Send a Mailchimp campaign. This triggers the campaign to be delivered
5
+ to all recipients in the audience. The campaign must have content set
6
+ and all required settings configured before sending.
7
+ ⚠️ This action requires approval as it triggers mass email delivery.
8
+
9
+ requires_approval: true
10
+
11
+ parameters:
12
+ server_prefix:
13
+ type: string
14
+ required: true
15
+ description: >
16
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
17
+ "abc123-us6" → server_prefix is "us6".
18
+ campaign_id:
19
+ type: string
20
+ required: true
21
+ description: >
22
+ The unique ID of the campaign to send. Obtained from mailchimp-create-campaign
23
+ response or from the Mailchimp dashboard.
24
+
25
+ execution:
26
+ type: http
27
+ method: POST
28
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/campaigns/{campaign_id}/actions/send'
29
+ headers:
30
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
31
+ Content-Type: application/json
32
+ timeout: 30000
33
+
34
+ authentication:
35
+ type: api_key
36
+ location: header
37
+ name: Authorization
38
+ notes:
39
+ env: MAILCHIMP_API_KEY
40
+
41
+ output_schema:
42
+ type: object
43
+ properties:
44
+ success:
45
+ type: boolean
46
+ statusCode:
47
+ type: number
48
+
49
+ error_handling:
50
+ retry: 1
51
+ backoff_type: linear
52
+ initial_delay_ms: 2000
53
+
54
+ examples:
55
+ - name: 'Send a prepared campaign'
56
+ params:
57
+ server_prefix: us6
58
+ campaign_id: a1b2c3d4e5
59
+ expected_result: 'Returns 204 No Content on success (success: true, statusCode: 204)'
@@ -0,0 +1,105 @@
1
+ name: mailchimp-update-list-member
2
+ version: '1.0.0'
3
+ description: >
4
+ Update an existing subscriber's information in a Mailchimp audience/list.
5
+ Use the subscriber_hash (MD5 hash of the lowercase email address) to identify the member.
6
+ Supports updating status, email address, and merge fields.
7
+
8
+ parameters:
9
+ server_prefix:
10
+ type: string
11
+ required: true
12
+ description: >
13
+ Your Mailchimp data center prefix (e.g. "us6"). Found at the end of your API key:
14
+ "abc123-us6" → server_prefix is "us6".
15
+ list_id:
16
+ type: string
17
+ required: true
18
+ description: The unique ID of the Mailchimp audience/list the member belongs to
19
+ subscriber_hash:
20
+ type: string
21
+ required: true
22
+ description: >
23
+ The MD5 hash of the subscriber's lowercase email address. You can generate this
24
+ using MD5("email@example.com"). Use the id field from mailchimp-add-list-member response.
25
+ status:
26
+ type: string
27
+ required: false
28
+ description: >
29
+ Update subscription status. Options: "subscribed", "unsubscribed", "pending", "cleaned"
30
+ enum:
31
+ - subscribed
32
+ - unsubscribed
33
+ - pending
34
+ - cleaned
35
+ email_address:
36
+ type: string
37
+ required: false
38
+ description: New email address for the subscriber (updates the email)
39
+ merge_fields:
40
+ type: object
41
+ required: false
42
+ description: >
43
+ Key-value pairs for merge fields to update. Example: {"FNAME": "Jane", "LNAME": "Smith"}
44
+
45
+ execution:
46
+ type: http
47
+ method: PATCH
48
+ url: 'https://{server_prefix}.api.mailchimp.com/3.0/lists/{list_id}/members/{subscriber_hash}'
49
+ headers:
50
+ Authorization: 'apikey {MAILCHIMP_API_KEY}'
51
+ Content-Type: application/json
52
+ body:
53
+ status: '{status}'
54
+ email_address: '{email_address}'
55
+ merge_fields: '{merge_fields}'
56
+ timeout: 30000
57
+
58
+ authentication:
59
+ type: api_key
60
+ location: header
61
+ name: Authorization
62
+ notes:
63
+ env: MAILCHIMP_API_KEY
64
+
65
+ output_schema:
66
+ type: object
67
+ properties:
68
+ success:
69
+ type: boolean
70
+ data:
71
+ type: object
72
+ properties:
73
+ id:
74
+ type: string
75
+ email_address:
76
+ type: string
77
+ status:
78
+ type: string
79
+ merge_fields:
80
+ type: object
81
+ list_id:
82
+ type: string
83
+
84
+ error_handling:
85
+ retry: 2
86
+ backoff_type: exponential
87
+ initial_delay_ms: 500
88
+
89
+ examples:
90
+ - name: 'Unsubscribe a member'
91
+ params:
92
+ server_prefix: us6
93
+ list_id: abc123def4
94
+ subscriber_hash: b775e3e869bc8eae5fcb23cdc5ec64ff
95
+ status: unsubscribed
96
+ expected_result: 'Returns updated member record with unsubscribed status'
97
+ - name: 'Update subscriber name'
98
+ params:
99
+ server_prefix: us6
100
+ list_id: abc123def4
101
+ subscriber_hash: b775e3e869bc8eae5fcb23cdc5ec64ff
102
+ merge_fields:
103
+ FNAME: Jane
104
+ LNAME: Smith
105
+ expected_result: 'Returns updated member record with new merge fields'