Integrating Dotdigital with PostPilot

Connect your Dotdigital flows to PostPilot to trigger perfectly timed direct mail campaigns.

Before you start

Things you need to know:

  • You must have a Dotdigital and PostPilot account.
  • You should be familiar with Dotdigital's Enable a program webhook article.

1. Create an API key and Flow in PostPilot

  1. To create an API connection in PostPilot, follow the directions in our Creating an API Connection for external use.

  2. To create a flow in PostPilot, which will be triggered by the program webhook in Dotdigital, follow the steps in our Using an External API Connection in PostPilot Flows article.

    You need the URL for the Flow you create in PostPilot to use in your webhook.

2. Create a PostPilot profile in Dotdigital

  1. Go to Connect > Webhooks.
  2. Select NEW WEBHOOK and in the side panel:
    1. For Webhook name enter PostPilot.
    2. For Base URL enter https://api.postpilot.com/v1.
  3. Leave the Limit request rate switch set to No.
  4. Expand the Authentication section, then expand the Authentication type drop-down menu and select None.
  5. Select SAVE.

3. Configure your PostPilot webhook

  1. Go to Automation > Programs, and create a new program, or edit an existing one.
    Learn more in the Program builder section of the Help Centre.

  2. From the Webhooks section of the left side panel, drag the PostPilot webhook node onto the canvas.

  3. Select the node to open the configuration side panel.

  4. For Endpoint, add the remaining URL path for the PostPilot Flow you created in step 1.

    You don’t need to include https://api.postpilot.com/v1 as this is the base URL automatically used for your webhook. For example, if the URL for your PostPilot Flow is https://api.postpilot.com/v1/12abc345-1a23-1234-5678-12abcde34567/flows/1234/triggers


    then you would only need to enter /12abc345-1a23-1234-5678-12abcde34567/flows/1234/triggers.

  5. Expand the Method drop-down menu and select POST.

  6. Expand the Content-type drop-down menu and select application/json.

  7. Optionally, add some Node text.
    This is a description which displays on the node on the program builder canvas.

  8. Expand the Headers and body data section, and in the Body data field, enter

{ 
"reference_id": "@EMAIL@",
"firstname": "@FIRSTNAME@",
"lastname": "@LASTNAME@",
"email": "@EMAIL@",
"line1": "@BILLING_ADDRESS_1@",
"line2": "@BILLING_ADDRESS_2@",
"city": "@BILLING_CITY@",
"state": "@BILLING_STATE@",
"postal_code": "@BILLING_POSTCODE@",
"country": "@BILLING_COUNTRY@"
}
⚠️ The above is an example; you might need to edit the code to include the relevant data field placeholders for your account. For example, you might use SHIPPING_ADDRESS_1 instead of BILLING_ADDRESS_1. You must also make sure that a data field exists in Dotdigital for each of the specified fields.
You don’t need to add any headers.
9. To test the webhook, select FIND CONTACT and then search for and select a contact to test to. The contact must exist in your Test list, and have data contained in the data fields you’re using in the webhook Body data field.
Select SUBMIT to make the test request. A response is provided in the side panel.
 

10. When you’re happy with your configuration, select APPLY.

 

Data requirements

It's always your responsibility to ensure you're supplying good, executable data, or your webhook could fail.

4. Activate the send block in PostPilot

Once you’ve completed the set up of your webhook and program in Dotdigital, return to PostPilot and activate the send block in your Flow to start sending mail to your customers and prospects using the webhook.
 

We advise that you clear any pending events in your PostPilot Flow before you enable the send block, in case any contacts were added to the Flow during testing.

Learn more in our Setting up your first Flow article.