Trigger the delivery of postcards, letters, and checks based on people’s behavior in your product or app by connecting Customer.io to Lob using Webhook Actions. Customer.io is a behavioral messaging platform that harnesses your application data to automate personalized marketing and transactional messages.
Using Customer.io Actions with Lob, you can control exactly who you reach and when. Send super-targeted direct mail like a thank you note to premium customers, a postcard with an offer code to people who haven’t logged into your app in 3 weeks, or a hard copy of a payment receipt following up from an email invoice.
In this walkthrough, let’s trigger a postcard to be sent to customers when they’ve been a paying subscriber for 3 months.
If you don’t have a Lob account, start by creating one over at Lob.com.
In your Lob account, you’ll want the API Key from your account. I’d recommend starting with your Test API Key from the settings menu.
Create a campaign in Customer.io where you want to add the webhook action. For our example, we’re using a segment triggered campaign with the segment “Paid 3 times” as our trigger:
Add a new webhook action in the campaign’s workflow:
After creating the webhook, Click “Add Request”. You’ll see the webhook composer.
Next to POST, add in the API key and postcard endpoint in this format: https://test_lob_api_key:@api.lob.com/v1/postcards - the API key followed by a colon : and an @ sign.
Note: If you’re trying to send a letter or a check, more endpoints are in the Lob documentation.
At this point, it should look something like:
Copy and paste this example code in to the content area for your webhook.
You’ll want to adjust the liquid for mailing addresses to match your custom attribute names in Customer.io.
For details on customizing the front or back of the postcard, take a look at the Lob documentation.
When you’re done, you’ll have a finished webhook that looks something like:
When you’re ready to test, you can click “Send Request”. Customer.io will show you the response from the Lob API.
If you’re successful you’ll see a 200 OK.
Then, in Lob, you’ll also see a postcard successfully created:
We’re excited to hear how you end up using Lob with Customer.io’s Webhook Action. Let us know in the comments or learn more about Actions.