Lob's website experience is not optimized for Internet Explorer.
Please choose another browser.

Arrow Up to go to top of page
Lob + Customer.io
August 1, 2016

Lob + Customer.io

Author Avatar
Shrav Mehta

See our updated post here.

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.

How to Use Lob With Customer.io

If you don’t have a Lob account, start by creating one over at Lob.com.

Register Now

Get Your Lob API Key

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 your campaign

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:

Lob + Customer.io image 2

Add a new webhook action in the campaign’s workflow:

Lob + Customer.io image 3

After creating the webhook, Click “Add Request”. You’ll see the webhook composer.

Lob + Customer.io image 4

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.

Example: https://test_0197a88d409165573ce9f1f812dcd50197a:@api.lob.com/v1/postcards

Note: If you’re trying to send a letter or a check, more endpoints are in the Lob API documentation.

At this point, it should look something like:

Lob + Customer.io image 5
Customize your postcard

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 API documentation.

When you’re done, you’ll have a finished webhook that looks something like:

Lob + Customer.io image 6
Send Request

When you’re ready to test, you can click “Send Request”. Customer.io will show you the response from the Lob API.

Lob + Customer.io image 7

If you’re successful you’ll see a 200 OK.

Then, in Lob, you’ll also see a postcard successfully created:

Lob + Customer.io image 8

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.

Continue Reading