Loading…

Show sent messages as tasks in Salesforce

Updated

You can send message information to Salesforce—the emails you send, whether or not people click them, and so on. In Salesforce, you’ll typically record these events as Tasks. When you send message events to Salesforce, you’ll need to map a few fields to make sure that Salesforce processes your message activity tasks properly.

How it works

The Task for Message Delivery action records message events from Customer.io as completed tasks in Salesforce. This makes it easy for you to see the messages you’ve sent, whether people have interacted with them, and so on—all in Salesforce. This helps you make your Salesforce environment a reliable source of truth.

To take advantage of this action, you need to make sure that you sync people from Salesforce to Customer.io with their Contact ID or Lead ID. That’s how we associate tasks with people in Salesforce.

The salesforce interface showing tasks representing emails
The salesforce interface showing tasks representing emails

Set up the Task for Message Delivery action

By default, we only record tasks for emails, but you could set up different actions to record tasks for other message types. See Message event triggers for more information.

  1. Go to Data & Integrations > Integrations and select your Salesforce Data out integration.

  2. Go to the Actions tab and click Add Action.

  3. Select Task for Message Delivery.

    The default settings for the Task for Message Delivery action
    The default settings for the Task for Message Delivery action

  4. Scroll down to The Contact or Lead ID to associate the task with (string) and select the attribute that contains your audience’s Contact or Lead ID. You may need to search for a variable in the drop-down.

    By default, when you sync people from Salesforce to Customer.io, we map Contact ID or Lead ID to their $.customer.id—but you could store it as another attributeA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. Attributes are analogous to traits in Data Pipelines.. If you’re not sure what attribute you use, you can find it in your Salesforce data-in integration. an animation showing how to set your Contact or Lead ID attribute

  5. Click Save action.

Now Salesforce will record completed tasks for email events.

What value is the Contact or Lead ID in Customer.io?

Normally, when you import Salesforce contacts or leads in Customer.io, we map Contact ID or Lead ID to their ID in Customer.io—but you could store it as another attributeA key-value pair that you associate with a person or an object—like a person’s name, the date they were created in your workspace, or a company’s billing date etc. Use attributes to target people and personalize messages. Attributes are analogous to traits in Data Pipelines.. If you don’t know what attribute you use to store a person’s Contact or Lead ID, you can find it in your Salesforce data-in integration.

  1. Go to Data & Integrations > Integrations and select your Salesforce Data in integration.
  2. Go to Syncs.
  3. Find your contact or lead sync and click > Edit.
    Find and edit your contact or lead sync
    Find and edit your contact or lead sync
  4. Click Edit next to Fields to Sync and find the attribute that contains the Contact or Lead ID.
    Find your contact or lead ID attribute in the Salesforce data-in integration
    Find your contact or lead ID attribute in the Salesforce data-in integration

This value is the ID you’ll use to associate the task with a person in Salesforce in the format $.customer.<attributeName>, e.g. $.customer.id.

What if I send a message to someone who isn’t in Salesforce?

Because we look for a value representing a person’s Contact or Lead ID in Customer.io—and that’s a condition for the action itself—Customer.io will ignore any message events for people who don’t have a Contact or Lead ID.

If you send a message to a person who isn’t in Salesforce, you won’t see anything in the Data out tab for your Salesforce integration.

Capturing a subset of events

By default, the Task for Message Delivery action captures all email events. That may include events that you don’t want to record as tasks. For example, you may only care about sends, clicks, and opens; you may only want to record tasks for specific campaigns or emails by their subject.

If you only want to capture specific email events, you can edit the trigger to capture only the events you want. But, because triggers don’t support nested and/or conditions, you may need to create different actionsA block in a campaign workflow—like a message, delay, or attribute change. for each set of criteria you use.

  1. Go to Data & Integrations > Integrations and select your Salesforce Data out integration.
  2. Go to the Actions tab and click Edit next to the Task for Message Delivery action.
  3. Update the Trigger to capture the events you want. You may want to use the subject field to capture a specific email. Or you could set the Track Event Name to Email Opened to capture all email opens but not other event types. We’ve provided examples below.

     You might need to create multiple actions

    Because triggers don’t support nested and/or conditions, you may need to create different actions for each set of criteria you use. For example, you may want to create an action for each email event you want to capture—e.g. one trigger for Email Sent and another for Email Opened if you only want to capture those two events.

    Email subject triggerSpecific email event trigger
    Update the trigger for the Task for Message Delivery action to capture emails with specific subjects
    Update the trigger for the Task for Message Delivery action to capture emails with specific subjects
    Update the trigger for the Task for Message Delivery action to capture email opened events
    Update the trigger for the Task for Message Delivery action to capture email opened events
  4. Click Save action.

Capture non-email message events

By default, the Task for Message Delivery action captures email-based message events. You can edit the trigger to capture different message events, but different message events contain different data—this may change the values you want to map to Salesforce tasks. We recommend that you create different actions for different message types.

We default to the email task type, but you can edit the task type to match the message type.

  1. Go to Data & Integrations > Integrations and select your Salesforce Data out integration.

  2. Go to the Actions tab and click Add Action.

  3. Select Task for Message Delivery.

    The default settings for the Task for Message Delivery action
    The default settings for the Task for Message Delivery action

  4. In the Trigger step change the Track Event Name to the kind of message events you want to capture: Push, SMS, or In-App.

    Update the trigger for the Task for Message Delivery action to capture push notifications
    Update the trigger for the Task for Message Delivery action to capture push notifications

  5. Click Save action.

Now Salesforce will record completed tasks for each non-email message event.

Set up an action to create tasks in Salesforce

Attribute enrichment requests

Message events from Customer.io don’t necessarily contain a person’s Contact or Lead ID, so we need to look up the person’s Contact or Lead ID in Customer.io. Then we send that enriched event to Salesforce, where it creates a task.

This means that for each message event, you’ll see two requests in the Data out tab for your Salesforce integration: one internal request to look up the Contact ID in Customer.io and the actual request to create the task in Salesforce. Since this second request is the only one that goes to Salesforce, this model doesn’t increase the number of Salesforce API calls you make as a part of your Customer.io integration.

In general, you don’t need to worry about the internal attribute enrichment requests, but it can help you see what data we’re fetching from Customer.io to map to users in Salesforce.

The Data out tab for your Salesforce integration showing two requests for a task
The Data out tab for your Salesforce integration showing two requests for a task

Message event triggers

By default, the Task for Message Delivery action captures all email events listed below. You can edit the trigger to capture different events for different message channels (push, sms, in-app), but different message events contain different data—this may change the values you want to map to Salesforce tasks—like the subject line. We recommend that you create different actions for different message types.

NameDescription
Email DraftedCustomer.io successfully rendered a message and populated liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}. for an individual recipient. The message is ready to send.
Email AttemptedAn email that couldn’t be sent to the delivery provider will be retried.
Email DeferredAn email that the delivery provider couldn’t send will be retried by the delivery provider.
Email SentAn email was sent from Customer.io to the delivery provider.
Email DeliveredThe delivery provider reported the email was delivered to an inbox.
Email OpenedAn email was opened.
Email Link ClickedA tracked link in an email was clicked.
Email ConvertedA person matched a conversion goal attributed to an email.
Email UnsubscribedA person unsubscribed via a particular email.
Email BouncedThe delivery provider was unable to deliver the email.
Email DroppedAn email wasn’t sent because it was addressed to a person who was suppressed.
Email Marked as SpamAn email was marked as spam by the recipient.
Email FailedAn email couldn’t be sent to the delivery provider.
Push DraftedCustomer.io successfully rendered a push notification and populated liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}. for an individual recipient. The message is ready to send.
Push AttemptedA push notification that couldn’t be sent to the delivery provider will be retried.
Push SentA push notification was sent from Customer.io to the delivery provider.
Push DeliveredA push notification was delivered to a recipient. You must use our SDKs or report delivered metrics to us using the API.
Push OpenedThe app on a person’s device reported the push notification was opened. You must use our SDKs or report opened metrics to us using the API.
Push Link ClickedA tracked link in a push notification has been clicked. Note that we do not track Clicked metrics or enable link tracking for push notifications by default. When a person taps a push notification, the message is marked as Opened. If you want to track links specifically, you’d need to send this metric back to us through the metric reporting API.
Push ConvertedA person matched a conversion goal attributed to a push notification.
Push BouncedThe delivery provider reported at least one invalid device token.
Push DroppedA push notification wasn’t sent because at least one device token previously bounced.
Push FailedA push notification couldn’t be sent to the delivery provider.
Push UndeliverableA push notification was undeliverable, likely because it hit a message limit.
SMS DraftedCustomer.io successfully rendered an SMS message and populated liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}. for an individual recipient. The message is ready to send.
SMS AttemptedAn SMS that couldn’t be sent to the delivery provider will be retried.
SMS SentAn SMS was sent from Customer.io to the delivery provider.
SMS DeliveredThe delivery provider reported the SMS was delivered.
SMS Link ClickedA tracked link in an SMS has been clicked.
SMS ConvertedA person matched a conversion goal attributed to an SMS.
SMS BouncedThe delivery provider was unable to deliver the SMS.
SMS FailedAn SMS couldn’t be sent to the delivery provider.
SMS UndeliverableAn SMS message was undeliverable, likely because it hit a message limit.
Slack DraftedCustomer.io successfully rendered a slack message and populated liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}. for an individual recipient. The message is ready to send.
Slack AttemptedA slack message that couldn’t be sent will be retried.
Slack SentA slack message was sent from Customer.io to slack.
Slack Link ClickedA tracked link in a slack message has been clicked.
Slack FailedA slack message couldn’t be sent to slack.
Slack UndeliverableA Slack message was undeliverable, likely because it hit a message limit.
Webhook DraftedCustomer.io successfully populated a webhook with liquidA syntax that supports variables, letting you personalize messages for your audience. For example, if you want to reference a person’s first name, you might use the variable {{customer.first_name}}. and is ready to send it.
Webhook AttemptedA webhook that couldn’t be sent will be retried.
Webhook SentA webhook was sent from Customer.io to the specified Webhook URL.
Webhook Link ClickedA tracked link in a webhook payload has been opened.
Webhook FailedA webhook couldn’t be sent to the specified Webhook URL.
In-App DraftedCustomer.io successfully rendered an in-app message and is ready to send it.
In-App AttemptedAn in-app that couldn’t be sent will be retried.
In-App SentAn in-app was sent.
In-App OpenedAn in-app was opened.
In-App ClickedA tracked response in an in-app was clicked.
In-App ConvertedA person matched a conversion goal attributed to an in-app.
In-App FailedAn in-app couldn’t be sent.
Copied to clipboard!
  Contents
Is this page helpful?