LogoLogo
API DocsTemplate GalleryProduct UpdatesContact Us
  • 📬Print & Mail
    • Ready to get started?
      • Pricing details
      • Fast Track Guide
    • Integrations
      • API integrations
        • Action IQ
        • Adobe Marketo Engage
        • Blueshift
        • Braze
        • Customer.io
        • Hubspot
        • Iterable
        • Jotform
        • Klayvio
        • Listrak
        • Make
        • Optimove
        • Salesforce
        • Salesforce Marketing Cloud
        • Segment
        • Simon Data
        • Zapier
      • No-code integrations
        • Agile CRM
        • Freshsales Suite
        • HubSpot
        • Microsoft Dynamics 365
        • Pipedrive
        • Salesforce
        • Salesforce Marketing Cloud
        • Zoho
      • Creative conversion tools
        • Figma plugin
    • Reaching your audience
      • Lob Audience
        • Target Audiences
        • Lookalike Audiences
        • Purchasing Audiences
      • All about addresses
      • Campaign audience guide
      • Additional Lob NCOA functionality
    • Designing mail creatives
      • Artboard layout
      • Creative formatting
        • PDF preflight checklist
        • Exporting PDFs from InDesign
        • Rendering errors
      • Mail piece design specs
        • Postcards
        • Self-Mailers
        • Letters
        • Letter envelopes
        • Letter add-ons
        • Checks
        • Snap packs
        • Booklets
        • Custom mail
      • Maximizing engagement
        • Dynamic personalization
          • Advanced templating (Handlebars)
            • Dynamic table tutorial
        • Adding QR codes
        • Short URLs
        • Informed Delivery
    • Building a mail strategy
      • One-time campaigns or triggered sends?
      • Choosing a delivery strategy
      • Managing mail settings
        • Using metadata
        • Declaring mail use type
      • USPS Promotions Through Lob
        • Tactile, Sensory & Interactive Promotion
        • Integrated Technology Promotion
        • First Class Mail Advertising Promotion
        • Add-Ons
      • Mailing class and postage
        • Certified Mail or Registered Mail
      • International mail
    • Send mail!
      • Launch your first campaign
      • Send mail via Print & Mail API
      • Send campaigns via the Campaigns API
      • USPS Secure Destruction
    • Getting data & results
      • Tracking your mail
      • Mail analytics
      • Measuring attribution
      • Using webhooks
      • Exporting mail data
  • 🏠Address Verification
    • Ready to start AV?
      • US AV product suite
      • International AV suite
      • AV pricing
    • AV best practices
    • AV integrations & libraries
      • AV Elements
      • Shopify App: Address Cleanser
    • AV FAQs
  • 💻Developer Docs
    • API quickstart guide
    • SDKs & libraries
    • Postman & similar tools
    • Error reference
    • Upgrading API version
    • Technical use case guides
      • Mass deletion setup
      • NCOA responses
      • Override cancellation window
      • Visibility of address changes
      • Ingesting tracking events with webhooks
  • 🔑Account Management
    • Signing into Lob
    • API keys
    • Account settings
      • Account-level data logs
    • User settings
    • Billing
      • Lob Credits
      • Lob Payment Methods
      • Sales Tax FAQ
        • Applicable sales tax by state
          • ​Subscriptions and Services
          • Lob Audience
          • Delivery Location for Operational Mail
          • Customer Billing Address for Operational Mail
          • Delivery Location for Marketing Mail
          • Postage Exemption
          • Professional Services
        • Tax exemption guide
  • 📞Resources
    • Getting support
    • Security & privacy
    • Data retention
    • Sustainability
    • Private labeling Lob
    • Direct mail glossary
Powered by GitBook
On this page
  • Overview
  • Getting Started
  • Create a Campaign in Customer.io
  • Setting up your Workflow
  • Configuring Your Webhook
  • Configuring Your Webhook Request
  • Sample JSON
  • Testing
  • Ingesting Mail Tracking Events from Lob into Customer.io

Was this helpful?

Export as PDF
  1. Print & Mail
  2. Integrations
  3. API integrations

Customer.io

Incorporating Intelligent Mail into Customer.io Workflows

PreviousBrazeNextHubspot

Last updated 9 months ago

Was this helpful?

Overview

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.

Getting Started

  1. Log into your . To start you’ll need your . It is highly recommended that you use your (secret) test API key first for testing.

  2. Have a (HTML template) ready to use.

  3. Sign in to your

Create a Campaign in Customer.io

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

Setting up your Workflow

  1. 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.

  1. 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.

Configuring Your Webhook

  1. You can configure it as follows:

  • Webhook Name: The Description of your Mail Event

  • Sending Behavior: Send automatically

Configuring Your Webhook Request

  1. Click on Add Request to begin the setup process.

  1. 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]

Sample JSON

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.

{
    "description": "Customer.IO to Lob Postcard Creation",
    "to": {
        "name": "{{ customer.name}}",
        "address_line1": "{{ customer.address_line1 }}",
        "address_line2": " ",
        "address_city": "{{ customer.address_city }}",
        "address_state": "{{ customer.address_state }}",
        "address_zip": "{{ customer.address_zip }}",
        "address_country": "US"
    },
    "from": {
        "name": "Lob Solutions",
        "address_line1": "210 King St",
        "address_line2": "3rd Floor",
        "address_city": "San Francisco",
        "address_state": "CA",
        "address_zip": "94107",
        "address_country": "US"
    },
    "front": "tmpl_xxxxxxxxxxxx",
    "back": "tmpl_xxxxxxxxxxxx",
    "size": "6x9",
    "merge_variables": {
        "name": "{{ customer.first_name }}"
    },
    "metadata": {
        "source": "Customer.IO"
    }
}

Testing

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.

  1. You can send a test by opening up the Request and clicking on Send Test in the top right corner.

  1. 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.

  1. You can also check the Test Results to ensure the request fields were correctly populated by the Liquid Statements.

  2. 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.

Ingesting Mail Tracking Events from Lob into Customer.io

  1. Start by creating a new Campaign within Customer.io and select: Create Your Own Trigger From A Webhook as the trigger.

  1. This will generate a URL to catch the webhook. Copy that to use within Lob in the next step.

  1. Under Create A New Webhook, enter a webhook description and paste in the URL generated by Customer.io.

  2. Finally, select the event you want to capture in Customer.io.

  1. 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.

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

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

Your API key will be either your Test or Live , 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 .

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

You will pass in the Customer attributes to populate this by using .

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. (.)

You can set up Webhooks within Lob to pass mail events (for example, Postcard Delivered) from Lob into Customer.io by using .

Navigate to to set up the webhook event you want to capture.

📬
Customer.io documentation on webhook setup here.
API key
Lob’s API documentation
Postcard > Create in Lob’s API documentation.
Liquid Statements
More information on creating personalized HTML templates
See here for more info on using Webhooks with Lob.
Customer.io’s Webhook Triggered Campaigns
Webhooks within the Lob dashboard
Configuring Your Webhook Request.
Customer.io
Lob account
API keys
creative file
Customer.io account.
Customer.io’s documentation here.
example