Spaces:
Running
Mailchimp Setup Guide
This guide shows how to set up Mailchimp Transactional for Care People email OTP.
Last reviewed: April 1, 2026
Important
For OTP email, use Mailchimp Transactional, not the regular Mailchimp marketing campaign API.
Mailchimp says Transactional is:
- a paid add-on available with
Standardplan or higher - purchased in blocks of
25,000emails per month - available in
demomode for first-time users
Official docs:
- https://mailchimp.com/help/add-or-remove-transactional-email/
- https://mailchimp.com/developer/transactional/guides/quick-start/
- https://mailchimp.com/developer/transactional/api/messages/send-new-message/
What you need first
- A Mailchimp account on
Standardplan or higher. - A domain email you control, for example
noreply@yourdomain.com. - Access to your DNS records.
Mailchimp recommends verifying and authenticating your domain. Their Help Center also notes that free mailbox providers like Gmail, Yahoo, or AOL cannot be verified/authenticated as your sending domain.
Official doc:
Step 1: Enable Mailchimp Transactional
In Mailchimp:
- Open
Automations. - Open
Transactional. - If you have never used it before, click
Try demo. - When ready, upgrade to a paid Transactional plan.
- Choose your monthly email block amount.
Mailchimp's help article says first-time users can start from demo mode, and paid plans are bought in monthly 25,000-email blocks.
Official doc:
Step 2: Launch the Transactional app
After enabling Transactional:
- Go to the
Transactionalpage in Mailchimp. - Click
Launch App. - This opens the Transactional/Mandrill area where API keys, templates, senders, and logs live.
Step 3: Create your API key
Mailchimp's Quick Start says to create the API key inside Transactional settings and copy it immediately because you cannot view it again later.
Steps:
- In the Transactional app, open
Settings. - Find the
API Keyssection. - Click
Create New Key. - Give it a descriptive name, for example
care-people-local. - Copy the key immediately and store it safely.
Official doc:
Step 4: Verify your sending domain
Mailchimp says domain verification proves you control the domain and helps inbox placement.
Steps:
- In Mailchimp, open
Account & billing. - Open
Domains. - In
Email Domains, clickAdd & Verify Domain. - Enter an address on your domain, for example
noreply@yourdomain.com. - Click
Send Verification Email. - Open the verification email and complete the verification.
Mailchimp also recommends domain authentication and DMARC after verification.
Official doc:
Step 5: Authenticate the domain
After verification, set up Mailchimp's recommended DNS authentication records for the same domain.
Why this matters:
- better deliverability
- lower spam-folder risk
- better sender reputation
From Mailchimp's verification article:
- they recommend both
verifyandauthenticate - they strongly recommend configuring
DMARC
Start here:
Step 6: Choose your sender addresses
Recommended sender setup:
- From email:
noreply@yourdomain.com - Reply-To:
support@yourdomain.com - From name:
Care People
Avoid using:
- personal Gmail addresses
- Yahoo/AOL senders
- addresses on domains you do not control
Step 7: Put the values into the backend
Update backend/.env:
MAILCHIMP_TRANSACTIONAL_ENABLED=true
MAILCHIMP_TRANSACTIONAL_API_KEY=your_real_transactional_api_key
MAILCHIMP_FROM_EMAIL=noreply@yourdomain.com
MAILCHIMP_FROM_NAME=Care People
MAILCHIMP_REPLY_TO=support@yourdomain.com
OTP_DEV_MODE=false
Notes:
- Keep
OTP_DEV_MODE=trueuntil your Mailchimp setup is verified. - Once real sending works, switch it to
false. - If
MAILCHIMP_TRANSACTIONAL_ENABLED=false, the backend stays in dev fallback mode and returns OTP in the API response.
Step 8: Restart and test the backend
From backend:
npm run dev
Then test:
- Import care_people.postman_collection.json
- Set
patientEmailto a mailbox you can receive - Run
Send Patient OTP - Confirm the OTP email arrives
- Run
Verify Patient OTP
Step 9: Test your API key directly
Mailchimp's Quick Start recommends testing with /users/ping.
PowerShell example:
$body = @{
key = "YOUR_API_KEY"
} | ConvertTo-Json
Invoke-RestMethod `
-Method Post `
-Uri "https://mandrillapp.com/api/1.0/users/ping" `
-ContentType "application/json" `
-Body $body
Expected result:
PONG!
Official doc:
Email templates
Current status in this repo:
- the backend currently sends OTP using inline HTML/text
- Mailchimp templates are optional right now
- you can still prepare templates now, then we can wire the backend to them in a follow-up step
Mailchimp's Transactional API supports both:
- classic Transactional templates via
/templates/... - Mailchimp Transactional templates via
/mctemplates/...
The API reference also lists:
/messages/send-template/messages/send-mc-template
Official doc:
- https://mailchimp.com/developer/transactional/api/messages/send-using-mailchimp-template/
- https://mailchimp.com/developer/transactional/api/templates/list-templates/
Recommended OTP template variables
If you want us to switch to templates later, create the template around these variables:
OTP_CODEOTP_MINUTESAPP_NAMESUPPORT_EMAIL
Suggested subject:
Your Care People OTP is *|OTP_CODE|*
Suggested body:
<div style="font-family: Arial, sans-serif; color: #1f2937; line-height: 1.6;">
<p>Hello,</p>
<p>Your Care People OTP is:</p>
<p style="font-size: 28px; font-weight: bold; letter-spacing: 4px;">*|OTP_CODE|*</p>
<p>This code is valid for *|OTP_MINUTES|* minutes.</p>
<p>Please do not share this code with anyone.</p>
<p>Care People Team</p>
</div>
Template workflow options
Option A: Create templates in the Transactional app UI
Use this when:
- non-developers may edit email copy later
- you want Mailchimp-managed template revisions
After the template exists, we can update the backend to send through the Mailchimp template route instead of inline HTML.
Option B: Create templates through the Transactional API
Mailchimp's API reference includes endpoints for:
/templates/add/templates/update/templates/publish/templates/list/templates/render
Important:
- publish the template after editing
- Mailchimp says published content is what new sends will use
Official doc:
Suggested naming
Use a clear name like:
care-people-otp-v1
That makes it easy to version later:
care-people-otp-v2care-people-welcome-v1care-people-appointment-confirmation-v1
Troubleshooting
API ping fails
Likely causes:
- wrong API key
- key copied incorrectly
- Transactional add-on not fully enabled yet
Check:
- Transactional app
Settings > API Keys - the
/users/pingtest
OTP sends in dev mode but not through Mailchimp
Check:
MAILCHIMP_TRANSACTIONAL_ENABLED=trueMAILCHIMP_TRANSACTIONAL_API_KEYis setMAILCHIMP_FROM_EMAILis setOTP_DEV_MODE=false
Messages go to spam
Check:
- domain verified
- domain authenticated
- DMARC configured
- from-address is on your own domain
Verification email never arrives
Mailchimp's domain verification article suggests:
- allow more time
- resend to another address on the same domain
- add
accountservices@mailchimp.comto safe senders - allowlist Mailchimp IPs if your IT/mail server is strict
Official doc:
Recommended rollout
- Enable Transactional in Mailchimp.
- Create API key.
- Verify and authenticate your domain.
- Put real credentials in backend/.env.
- Keep
OTP_DEV_MODE=truefor the first test. - Confirm live email delivery.
- Turn
OTP_DEV_MODE=false. - Optionally create and publish an OTP template.
- If you want, I can then switch the backend from inline HTML to template-based sending.