Integrations

Link with CRMs or Email Tools

Push donor info into Mailchimp

Push donor info into Mailchimp

Written By: Winnie Mulli

Last Updated on June 23, 2025

🔁 5.3 Link With CRMs or Email Tools

Integration focus: Mailchimp
Use case: Send welcome emails, tag donor segments, build engagement flows - all triggered directly from the webhook after a Payfast donation.

🧩 How It Works

When a Payfast donation is received, the Pappr Webhook already stores the donor’s name, email, and donation details in Supabase. This step adds automation: once the webhook receives this data, it sends the donor to Mailchimp using the Mailchimp Marketing API.

⚙️ Step-by-Step Mailchimp Integration

Step 1: Create a Mailchimp Audience (List)

  1. Log into https://mailchimp.com

  2. Go to Audience > Create Audience

  3. Name it something like Pappr Donors

  4. Define required fields (email is mandatory, name is optional)

💡 Enable tags and double opt-in if you want to comply with POPIA best practices.

Step 2: Generate a Mailchimp API Key

  1. Go to Account > Extras > API Keys

  2. Click Create A Key

  3. Copy and store your key securely

🔐 This key will be used by the webhook to authenticate and send data.

Step 3: Get Your Audience ID

  1. In Mailchimp, navigate to Audience Settings

  2. Click Audience name and defaults

  3. Find the Audience ID (a string like a1b2c3d4e5)

Step 4: Install Mailchimp SDK in Your Webhook Project

From your webhook directory, run:

npm

Step 5: Add Mailchimp Setup to server.js

At the top of your file:

import mailchimp from '@mailchimp/mailchimp_marketing';

mailchimp.setConfig({
  apiKey: process.env.MAILCHIMP_API_KEY,
  server: 'us21' // This comes from your API key prefix (e.g., us21)
});

In your .env file:


Step 6: Add Mailchimp Sync to Your Webhook Endpoint

Inside your /payfast-webhook route:

try {
  await mailchimp.lists.addListMember(process.env.MAILCHIMP_AUDIENCE_ID, {
    email_address: email_address,
    status: 'subscribed',
    merge_fields: {
      FNAME: name_first
    },
    tags: ['Pappr Donor']
  });
} catch (mailchimpError) {
  console.error('Mailchimp Error:', mailchimpError);
}

This will automatically:

  • Add the donor to your Mailchimp list

  • Tag them as a "Pappr Donor"

  • Include their first name for email personalisation

Step 7: Test the Integration

Send a test webhook (via Postman or Payfast sandbox), and confirm:

  • The data appears in Supabase

  • A new contact appears in Mailchimp under your audience

  • The contact has the correct name and tag

Optional: Trigger a Welcome Email Flow

Inside Mailchimp:

  1. Go to Automations > Customer Journeys

  2. Create a new journey:

    • Trigger: Contact added with tag Pappr Donor

    • Action: Send welcome email, impact summary, or thank-you note

You can also segment by campaign or donation amount using additional merge fields.

✅ Summary

With this setup, each new donor is:

  1. Stored securely in Supabase

  2. Automatically added to your Mailchimp list

  3. Segmented for follow-ups and engagement

  4. Ready for automation workflows