Skip to content

Email Service Integration - MailChimp - Marketing email

Target Audience: Developers, Stakeholders

Creating your MailChimp account

In order to get started with your first marketing email through MailChimp, a MailChimp account naturally has to be created. You can create a free MailChimp account here.

Fetching your API key

In order for Payway to be able to notify MailChimp about updated marketing preferences, an API Key is required.

In order to obtain your MailChimp API key, navigate to Profile => Extras => API keys => Create A Key and follow the on-screen instructions. Be sure to save your generated API key somewhere safe, as you will need it later.

Configuring your sending domain

Having the MailChimp account created and the API key fetched, we can now move on to configuring your sending domain. This is a process that validates that you, in fact, own the domain that you say you do, and allow email's to be sent from that given domain.

In order to configure your sending domain, perform the following steps:

  1. From within MailChimp, navigate to Profile => Domains => Add & Verify Domain.
  2. Enter an email address belonging to the domain you wish to send your email from.
  3. Follow the on-screen guide provided by MailChimp to verify your domain. This will require changes to your DNS records.

Configuring your audience

In order to start syncing your customers marketing preferences between Payway and MailChimp, we must know what the relation between Payway and MailChimp looks like.

In order to configure this relation, perform the following steps:

  1. From within MailChimp, navigate to Audience => All contacts. If you have multiple audiences, make sure you select the correct one!
  2. Select Settings => Audience name and defaults, and take note of the Audience ID. Save this ID somewhere safe, as you will need it shortly.
  3. From within the Payway Administration Portal, navigate to Control panel => Marketing permissions, and select the marketing permission you would like to bind to your MailChimp marketing emails.
    • Note: The selected marketing permission must be of the Newsletter type. Other types are currently not supported.
  4. In the Integration code field, paste in your Audience ID, and separated by a colon, the tag you would like to assign each customer that is added to this marketing list.

For example, if our Audience ID is "ABC123" and we would like to assign the tag "new-customer" to each customer being added to our marketing list, we would type in the following: ABC123:new-customer.

This means that whenever a customer is added to our marketing lists, they will be subscribed to the "ABC123" audience, with the "new-customer" tag. If the customer is ever removed from our marketing lists, they will be unsubscribed from the "ABC123" audience, and the "new-customer" tag will be removed.

Configuring your MailChimp callback

With the previous step completed, we are now ready to start syncing marketing preferences from Payway and to MailChimp. However, one additional case remains, which is the fact that the customer also has the option to unsubscribe from your marketing email directly from the email itself.

In order for Payway to be notified about such an action, we must register a callback URL that MailChimp can use, to notify Payway about this change. To do so, the following steps can be performed:

  1. From within MailChimp, navigate to Audience => All contacts. If you have multiple audiences, make sure you select the correct one!
  2. Select Settings => Webhooks => Create New Webhook
  3. In the Webhook URL, paste in the correct URL depending on your environment according to the table below.
  4. Under What type of updates should we send?, uncheck everything except for Unsubscribes
  5. Under Only send updates when a change is made ..., uncheck everything except for By a subscriber and By an account admin
Environment URL Comment
Stage https://payway-api.stage.adeprimo.se/api/mail_provider_callback/mailchimp/<organisation_id>/<secret> <organisation_id>: The ID of your Payway instance/organisation
<secret>: Secret that can be obtained by contacting Payway Support
Production https://backend.worldoftulo.com/api/mail_provider_callback/mailchimp/<organisation_id>/<secret> <organisation_id>: The ID of your Payway instance/organisation
<secret>: Secret that can be obtained by contacting Payway Support

Sending your first email

Once you have gotten this far, you're almost through the finishing line!

Now, all that remains, is to simply contact our support. Information that must be included in this request are:

  • Your Mailchimp API Key
  • Your sender email address (the email address that your email's should originate from)

Once your support request has been sent and we have had time to process it, you can start sending your first emails from MailChimp!