Send query results to Mailchimp

Mailchimp is a cloud-based marketing automation platform and an email marketing service that provides an API for integrating with third-party systems and a web UI for managing email contacts, templates, and lists.

Note

This destination uses the Mailchimp REST API .

This topic describes the steps that are required to send audience lists to Mailchimp from Amperity:

  1. Build a query

  2. Add orchestration

  3. Run orchestration

Note

Mailchimp must be enabled before you can configure an orchestration to send query results. Ask your DataGrid Operator or Amperity representative to enable Mailchimp for your tenant.

Build query

You will need to build a query that outputs fields that can be mapped to audience fields tags in Mailchimp. For example, a Mailchimp audience may have the following fields and field tags:

Mailchimp Fields

Field Tags

Description

email_address

email

Required.

first_name

FNAME

Optional.

last_name

LNAME

Optional.

address

ADDRESS

Optional.

phone_number

PHONE

Optional.

birthday

BIRTHDAY

Optional.

status

status_if_new

Required. Must have a value of “subscribed” or “unsubscribed” because data template mappings do not provide type conversions.

Example

The customer 360 database can provide email, first name, last name, and birthdate data. Use another table in the customer 360 database to keep a list of known email addresses with their subscription status available from a status column that can provide “subscribed” and “unsubscribed” values.

Build a query named “Mailchimp - Upcoming Birthdays” to collect email address, first name, last name, and birthdate data from the customer 360 database, but with a window for birthdays that spans “within the next 10 days from the current date”, and then find only those individuals who are also subscribed to the mailing list:

SELECT
  c360.email
  ,c360.given_name
  ,c360.surname
  ,c360.birthdate
  ,el.status
  ,DATE_FORMAT(birthdate, '%m-%d')
  ,current_date
FROM Customer360 c360
LEFT JOIN Email_List el ON c360.email = el.email
WHERE DATE_FORMAT(birthdate, '%m-%d') = DATE_FORMAT((CURRENT_TIMESTAMP AT TIME ZONE 'America/Los_Angeles'+ interval '10' day), '%m-%d')
AND status = 'subscribed'

which outputs results similar to:

------------------------ ------------ ---------- ----------- ------------
 email                    given_name   surname    birthdate   status
------------------------ ------------ ---------- ----------- ------------
 triley@perezinc.com      Tyler        Riley      02-19       subscribed
 act_austin@rushllc.org   Austin       Williams   02-20       subscribed
 swelch@kellyllc.com      Sandra       Welch      02-20       subscribed
 justincurrie@mmail.com   Justin       Currie     02-21       subscribed
 ...
------------------------ ------------ ---------- ----------- ------------

Add orchestration

An orchestration defines the relationship between query results and a destination, including the location to which those query results will be sent and the frequency at which the orchestration will be run.

To add an orchestration

  1. From the Destinations tab, click Add Orchestration. This opens the Add Orchestration dialog box.

  2. From the Object Type drop-down, select Query.

  3. From the Object drop-down, select the query for which results will be sent to Mailchimp.

  4. From the Destination drop-down, select a destination that is configured for sending data to Mailchimp.

  5. From the Data Template drop-down, select a data template.

  6. Verify all settings.

  7. Set the workflow to Manual. (You can change this to automatic later, after verifying the end-to-end workflow.)

  8. Click Save.

Run orchestration

Run the orchestration manually to validate that it works.

To run the orchestration

  1. From the Destinations tab, under Orchestrations, open the    menu for the Mailchimp orchestration, and then select Run.

  2. The Status column for the orchestration will update to say “Waiting to start…”, after which the notifications pane will update to include a notification that shows the current status.

  3. When the orchestration has run successfully, the status is updated to “Completed”.