3. Send gift recipient emails from Mailchimp (Beta)
Using Mailchimp instead of Klaviyo? A beta recipe that uses Shopify Flow and Zapier to send gift recipients a branded email from your own Mailchimp account.
Written By Giftnote Team
Last updated About 19 hours ago
Beta: a workaround, not a built-in integration. Giftnote doesn't connect to Mailchimp directly yet. This recipe uses Shopify Flow, Zapier and Mailchimp to do the same job as our Klaviyo recipient flow. We've checked each step against Shopify, Zapier and Mailchimp's documentation, but we haven't run it end to end on a live store yet. Test it with your own email address before you switch it on, and tell us how it goes at support@giftnote.com. Your feedback decides whether we build a proper Mailchimp integration.
When someone sends a gift with Giftnote, the recipient gets Giftnote's standard gift email. If you use Klaviyo, you can replace that with your own branded email (see Ready-made Klaviyo flows from Giftnote). This recipe does the same for Mailchimp. It's most useful for digital products and memberships, where the recipient needs to know what they've received and how to access it.
1. How it works
- Giftnote delivers the gift message and fires the Order message delivered trigger in Shopify Flow.
- Flow sends the gift details (who it's to, who it's from, the message and the recipient's email) to Zapier.
- Zapier sends your Mailchimp template to the recipient through Mailchimp Transactional.
2. Before you start: check your plans
All four are needed. If any one is missing, this recipe won't work for you.
- Shopify: Grow, Advanced or Plus. Flow's Send HTTP request action isn't available on the Basic plan.
- Mailchimp: Standard or Premium, plus the Transactional add-on. Transactional costs $20 per block of 25,000 emails a month and can't be added to the Essentials plan.
- Zapier: a paid plan (Professional or higher). The Webhooks by Zapier trigger isn't on the free plan. Each gift uses about one Zapier task.
- Access to your domain's DNS settings. Mailchimp Transactional only sends from a verified domain.
3. Why it has to be Mailchimp Transactional
Most gift recipients have never bought from you and haven't agreed to receive marketing. Mailchimp journeys and campaigns only send to subscribed contacts, so they can't reach recipients. Don't subscribe recipients just to make a journey work: you need their consent first. Mailchimp Transactional sends one-off service emails to anyone, which is what a gift delivery email is.
Keep the email about the gift. A gift delivery email is a service message, so you can include: who sent it, their message, what the gift is, how to access or redeem it, and how to contact you. Adding discount codes, product recommendations or "shop more" content turns it into marketing, and in the UK and EU you'd need the recipient's consent to send it. This is general guidance, not legal advice.
4. Set up Mailchimp Transactional
- In Mailchimp, add Transactional Email to your account and buy one block.
- In Transactional, go to Settings β Domains, add your sending domain and add the DNS records it shows you (two DKIM records and a DMARC record). Wait until the domain shows as verified. Emails from an unverified domain are rejected.
- In Transactional, go to Settings β SMTP & API Info and create an API key. Keep it private.
- In Mailchimp, design your gift email as a template. Use these merge tags where the gift details should go:
*|GIFT_TO|*,*|GIFT_FROM|*and*|GIFT_MESSAGE|*. - Open the template, choose Send to Mandrill, and publish it in Transactional. Note the template's slug (for example
gift-recipient).
If you edit the template later in Mailchimp, choose Send to Mandrill and publish it again. Transactional doesn't pick up the changes on its own.
5. Create the Zap
- Create a new Zap. For the trigger, choose Webhooks by Zapier β Catch Hook. Copy the webhook URL it gives you.
- Add a Code by Zapier β Run Python step. Under Input Data, add these fields and map them from the Catch Hook:
order_id,recipient_email,gift_to,gift_from,gift_message. Add two more fields typed in by hand:api_key(your Transactional API key) andtemplate(your template slug). - Paste in the code below. It skips gifts it has already emailed, so you never send the same recipient two emails, and it stops the Zap with an error if Mailchimp rejects the email.
import requests, html
store = StoreClient('giftnote-mailchimp')
dedupe_key = str(input_data['order_id']) + '|' + input_data['recipient_email'].lower()
if store.get(dedupe_key):
output = {'status': 'skipped: already sent'}
else:
message = html.escape(input_data.get('gift_message', '')).replace('\n', '<br>')
payload = {
'key': input_data['api_key'],
'template_name': input_data['template'],
'template_content': [],
'message': {
'to': [{'email': input_data['recipient_email'], 'name': input_data.get('gift_to', ''), 'type': 'to'}],
'merge_language': 'mailchimp',
'global_merge_vars': [
{'name': 'GIFT_TO', 'content': html.escape(input_data.get('gift_to', ''))},
{'name': 'GIFT_FROM', 'content': html.escape(input_data.get('gift_from', ''))},
{'name': 'GIFT_MESSAGE', 'content': message},
],
'tags': ['giftnote-recipient'],
},
}
r = requests.post('https://mandrillapp.com/api/1.0/messages/send-template', json=payload, timeout=20)
r.raise_for_status()
result = r.json()[0]
if result.get('status') not in ('sent', 'queued'):
raise Exception('Mailchimp rejected the email: ' + str(result.get('reject_reason')))
store.set(dedupe_key, 'sent')
output = {'status': result.get('status'), 'id': result.get('_id')}Turn on Zapier's error notifications. Once Zapier has received the gift details, Shopify Flow always reports success, even if the Zapier step fails afterwards. Check your Zap history to catch problems.
6. Build the Shopify Flow workflow
- In Shopify Flow, create a new workflow. For the trigger, choose Giftnote β Order message delivered.
- Add a condition: Recipient email is not empty. Gifts sent by SMS only have no email address, so this skips them.
- Under Then, add Send HTTP request. Set the method to POST, paste your Zapier webhook URL, and add a header with key
Content-Typeand valueapplication/json. - Use this as the body. Insert each value with Add variable so the names match your store, then add
| jsoninside the braces as shown. Don't put quote marks around the variables:| jsonadds them for you and handles emoji, quotes and line breaks in the message.
{
"order_id": {{ order.id | json }},
"recipient_email": {{ recipientEmail | json }},
"gift_to": {{ to | json }},
"gift_from": {{ from | json }},
"gift_message": {{ message | json }}
}- Set On client error (4XX) to Fail, and leave server errors on Retry.
- Turn the workflow on, place a test gift order addressed to your own email, and check that the email arrives and looks right.
7. What to test before going live
These are the parts we haven't confirmed yet. Please check them on your store and tell us what you find.
- A message with emoji, quote marks and line breaks displays correctly.
- A scheduled gift sends the email on the delivery date, not the purchase date.
- An SMS-only gift doesn't send anything to Zapier.
- A Multi Gift order sends one email per recipient.
- Only one email arrives per gift.
- The email lands in the inbox, not spam.
8. Known limits
- Gift cards: gift card messages use a separate trigger, Gift card message delivered. Build a second workflow with that trigger if you also want branded gift card emails.
- Turn off Giftnote's own email once yours is working, or recipients will get two emails. Do this from the recipient notification settings in Giftnote.
- Adding recipients to your audience: you can add recipients to Mailchimp as non-subscribed (transactional) contacts with a gift-recipient tag, but they must not be subscribed to marketing unless they opt in themselves. If you want this, contact us and we'll help you set it up.
- Long-term option: Giftnote's Klaviyo integration does all of this with no Zapier step, plus ready-made flows. See Klaviyo flow templates and event reference.
Related articles
Was this helpful?
More in Shopify
1. Shopify FlowStill need help? Share an idea