Customer.io
Incorporating Intelligent Mail into Customer.io Workflows
Last updated
Incorporating Intelligent Mail into Customer.io Workflows
Last updated
Customer.io is a popular messaging automation platform that empowers its customers to create personalized message flows to engage their audience. Traditionally these have been channels like email and SMS. However, with Lob, you can bring Intelligent Mail into your omnichannel customer journey and manage it just as easily as your digital channels.
Log into your Lob account. To start you’ll need your API keys. It is highly recommended that you use your (secret) test API key first for testing.
Have a creative file (HTML template) ready to use.
Sign in to your Customer.io account.
We will be bringing Lob into Customer.io within the Workflow step of a Campaign. In order to set up a Workflow, you will need to first create the Campaign within Customer.io and configure your Trigger, Settings, and Goal & Exit steps. Complete instructions on this can be found in Customer.io’s documentation here.
Once you reach the workflow screen, you can begin crafting your customer journey by creating the event path your users will follow. Below is a standard example of an event trigger (User Purchase) followed by a standard Welcome Email.
We can incorporate Intelligent Mail into this Workflow in a similar manner to email by adding a Webhook node. We can do this by dragging in a Send And Receive Data tile from the left-side menu.
Now you will have an empty webhook, which you can configure by clicking to open it. This will open an edit screen in the left panel. You can find Customer.io documentation on webhook setup here.
You can configure it as follows:
Webhook Name: The Description of your Mail Event
Add Request: This is where we will add the Lob Endpoint URL and the JSON code that will format the information being passed from Customer.io to Lob. More details on this below in Configuring Your Webhook Request.
Sending Behavior: Send automatically
Click on Add Request to begin the setup process.
Next to POST, you will construct the Lob endpoint URL for the type of resource you are trying to create.
The format is as follows: https://+[YOUR LOB API KEY]+@api.lob.com/v1/[RESOURCE TYPE]
Your API key will be either your Test or Live API key, which you can find in your Lob dashboard under Settings. It is strongly recommended that you begin with your Test API Key to ensure it is working, before switching to your Live API Key.
The Resource Type will depend on the mail format you are trying to send. For example, postcards, letters, or self_mailers. You can find all of the available resource types in Lob’s API documentation.
In the black box, you will construct your JSON to pass the required information to Lob’s API to generate a mailpiece. For example, see Postcard > Create in Lob’s API documentation.
You will pass in the Customer attributes to populate this by using Liquid Statements.
This will enable to you not only pass in the recipient’s name and address, but also personalize your mailpiece by using Liquid to populate dynamic merge variables. (More information on creating personalized HTML templates.)
Below is sample JSON you can test within your Customer.io webhook.
Before testing this, replace the front and back with template IDs from your own Lob account.
Once your webhook has been configured, you will want to test it.
Remember that you should be using your Test API Key for this, as you will otherwise generate live mail.
You can send a test by opening up the Request and clicking on Send Test in the top right corner.
Once you confirm and send, you will want to see a 200 OK response in your Test Results. This will indicate that the request has successfully reached Lob.
You can also check the Test Results to ensure the request fields were correctly populated by the Liquid Statements.
You can then log into your Lob account to verify that the mailipiece was successfully generated. Preview it to make sure all of the details are correct. If so, then you have successfully set up your Customer.io to Lob integration, and are ready to send Live Intelligent Mail.
You can set up Webhooks within Lob to pass mail events (for example, Postcard Delivered) from Lob into Customer.io by using Customer.io’s Webhook Triggered Campaigns.
Start by creating a new Campaign within Customer.io and select: Create Your Own Trigger From A Webhook as the trigger.
This will generate a URL to catch the webhook. Copy that to use within Lob in the next step.
Navigate to Webhooks within the Lob dashboard to set up the webhook event you want to capture.
Under Create A New Webhook, enter a webhook description and paste in the URL generated by Customer.io.
Finally, select the event you want to capture in Customer.io.
From here you can use the data on the incoming webhook to track as events or update attributes for users within Customer.io. This also enables you to trigger subsequent events—for example, you can imagine an omnichannel customer journey in which a customer receives a Lob postcard, and that automatically triggers an email to that same customer telling them to check their mailbox for a great offer.
Once you have incorporated both sending Lob mail and capturing Lob events within Customer.io, you will have truly automated direct mail, and integrated within your broader digital customer journeys.