This feature is in BETA. Contact your Customer Success Representative for more information.

You can activate your various segments to Sailthru for personalized email marketing campaigns enabling you to provide a better customer experience.

Sailthru is a marketing automation solution that powers your every marketing email need, including campaigns, triggered and transactional email. Sailthru’s proprietary algorithms can personalize on the individual level for your emails, website, and mobile app. It’s all powered by their customer profiles. They help you send 5 million different emails to 5 million different customers.  Their recommendation algorithms can personalize products, content, discounts and offers, customer journey touch points, and even email acquisition pop-ups.

This integration enables your marketing team to:

  • Send lists of users from a segment to Sailthru to prepare the corresponding marketing campaigns on the system, and keep those lists automatically synchronized.

  • Update all user information with different profiles from Sailthru to provide a better-personalized experience for the customer through various marketing campaigns.

This topic includes:

Prerequisites

  • Basic knowledge of Sailthru and a Sailthru account

  • Basic Knowledge of Treasure Data

Limitations

There are some inherent limitations from Sailthru API:

  • The custom field (e.g. vars) name adheres to Sailthru specifications.

  • The maximum number of custom fields for users is 1000. (https://getstarted.sailthru.com/developers/api/user/#Error_Codes).

  • The maximum number of primary lists is 50. Error message if this cap is hit: “You may only track up to 50 primary lists".

  • The maximum number of total lists (including primary and secondary) is 2000. Error message if this cap is hit: “Maximum list count reached: 2000“. 

  • On Bulk User export mode (target: bulk_user), signup_date column won’t be updated if the batch is included with lists (either via source data’s column or result export configuration)

  • sms key isn’t fully tested by Treasure Data.

  • signup_date column is in the CEST timezone. Refer to the Sailthru API document for examples of the supported format.

Use the TD Console to Create Your Connection

Obtain Your API Key and Secret

  1. Log in to Sailthru. Navigate to https://my.sailthru.com/settings/api_postbacks.

  2. Select the lock icon for API Key and Secret.

  3. A dialog opens to show the API Key and Secret. This is needed to create a new connection.

Create a New Connection

Create and configure the data connection to be used during export, prior to running your query. As part of the data connection, you provide authentication to access the integration.

  1. Open TD Console.

  2. Navigate to Integrations Hub > Catalog

  3. Search for and select Sailthru.

  4. The New Authentication dialog opens.


  5. Enter the API Key and Secret.

  6. Enter a name for your connection.

  7. Select Done.

Query Examples for Sailthru

Example query with valid result data:

For List export mode:

SELECT 'my@email.com' as email;


For User or Bulk User export mode:

SELECT 'my@email.com' as id,
       '012345' as sms,
       '123' as sid,
       'My Name' as name,
       'Mar 11' as dob; 

Configure Export Results in Your Data Connection

Create or reuse a query. In the query, you configure the data connection.

About List Mode

Exporting your customer lists from Treasure Data to Sailthru triggers a corresponding Sailthru job (or several depending on the data size; generally, it will be split by 1GB per job). Because of this asynchronicity, there is a latency between when a TD job is finished, and when data is visible on the Sailthru platform. The result of your query must contain a column email.

About User Mode

This creates new and updates existing users, allowing the export of more information for the user type. This is slower than List Export Mode because requests are executed in a per-row manner. Using this mode, Lifecycle events are triggered.

Your query result must contain the following required columns.

Column

Description

Type

Required

id

Values are either email, sid, extid, or sms. This value is dependent on the value of the ID Type configuration parameter.

string

Required

optout_email

Either “none”, “basic”, “all” or “blast” or NULL.

string

Optional

lists

Comma-separated lists of Sailthru List. See the Lists configuration parameter for the examples.

string

Optional

optout_templates

Comma-separated lists of Sailthru Optout Templates. See the Opt-out Templates configuration parameter for an example of valid values.

string

Optional

The columns that are specified on Keys and Vars parameters are optional.

About Bulk User Mode

Similar to User Mode, Bulk User mode creates new and updates existing users, allowing the export of more information for the user type. The major difference is that it won’t trigger Lifecycle events. Submissions to Sailthru API are done in the same manner with List Mode, by asynchronous bulk jobs.

Your query result can contain these columns:

Column

Description

Type

Required

id

Values are either email, sid, extid, or sms. This value is dependent on the value of the ID Type configuration parameter.

string

Required

signup_date

The Sailthru-accepted date formatted string. For example: "Jan 18, 2013", “2016-07-01“. See Sailthru API document for more details.

string

Optional

optout

Either “none”, “basic”, “all” or NULL.

string

Optional

lists

Comma-separated lists of Sailthru List. See also Lists configuration parameter, for example, valid values.

string

Optional

The columns that are specified on Keys and Vars parameters are optional.

  1. Open the TD Console.

  2. Navigate to Data Workbench > Queries.

  3. Select the query that you plan to use to export data.

  4. Select Export Results located at top of your query editor. 
    The Choose Integration dialog opens.

  5. Choose the authentication you created (or create a new one).

  6. Select Next.

  7. Configure the target output data type and its corresponding parameters.
    The following Export Modes are supported:

    • List: Export emails to a specified list.

    • User: Create or update existing users by their ID. This will trigger Lifecycle events.

    • Bulk User: Create or update existing users by their ID by Sailthru bulk job. This won’t trigger Lifecycle events.

  8. Optionally, configure one of the following:

  1. Select List for Export Mode.


  2. Type your destination list name.

    A new list is created if it doesn’t exist or existing list updates. You can checklist names on Sailthru.

  3. Select either Primary or Secondary:

    Primary lists are your main lists of subscribers that you send to on a regular and periodic basis. If you wish to track the growth of a list, it must be marked as primary.

    Secondary lists are lists for which you do not need growth reporting. Their growth is not tracked, so they will not show up in the Primary List reports.

    If an option is selected, it will update the existing list to this type. See Sailthru for the difference between primary and secondary lists.

  4. Optionally, type the name that will be presented to your subscribers (i.e. on an opt-out page).

  1. Select User for Export Mode.


  2. Select the corresponding type of your id column --email, sms, sid, extid.

  3. Optionally, If Ignore Error Records selected, export jobs will still proceed even if a user cannot be created/updated. If left unchecked, the Treasure Data jobs terminate if an error record occurs. Submitted (Sailthru) jobs can rollback. Unlike User export mode, “Ignore Error Records” is only for some client-side validation (for example, the malformed syntax of Lists or Vars). Other kinds of invalid records are automatically ignored in Sailthru’s jobs by default.

  4. Optionally, add comma separated key columns to update the user’s keys.
    The column name has to match the key type exactly.

  5. Type a value for Key Conflict Resolution.
    error: terminates the job if a conflict occurs. For example, the changed keys match with another that already exists in the Sailthru database.

    merge: attempts to resolve the conflicted users with users that having the current id.

  6. Optionally, update the Lists that the user belongs to.
    The value has to conform to the syntax of:
    "<List Name>": 0|1, "<Another List Name>": 0|1, ...
    0 will remove users from the list.
    1 will add users to the list (if not already existing).

  7. Add or remove users from the opt-out templates.

  1. Select Bulk User for Export Mode.


  2. Select the corresponding type of your id column --email, sms, sid, extid.

  3. Optionally, If Ignore Error Records selected, export jobs will still proceed even if a user cannot be created/updated. If left unchecked, TreasureData-side jobs terminate if an error record occurs. Submitted (Sailthru-side) jobs cannot rollback. Notes that unlike User export mode, “Ignore Error Records” is meant only for some client-side validation (for example, the malformed syntax of Lists or Vars). Other kinds of invalid records will be automatically ignored in Sailthru’s jobs by default.

  4. Optionally, add comma separated key columns to update the user’s keys.
    The column name has to match the key type exactly.

  5. Optionally, update the Lists to which the user belongs.
    The value must conform to the syntax of:
    "<List Name>": 0|1, "<Another List Name>": 0|1, ...
    0 will remove users from the list.
    1 will add users to the list (if not already existing).

Optionally Use Scheduled Jobs for Export

You can use Scheduled Jobs with Result Export, to periodically write the output result to a target destination that you specify.

Optionally Configure Export Results in Workflow

Within Treasure Workflow, you can specify the use of this data connector to export data.

Example: Workflow Exporting Emails to a List

_export:
  td:
    database: sample_datasets

+export_to_sailthru:
  td>: queries/samples.sql
  result_connection: my_sailthru_connection
  result_settings:
    target: bulk_user
    bulk_user_key: email
    bulk_user_lists: '"My List": 1'
    bulk_user_keys_column: sms, sid
    bulk_user_vars_columns: name, dob
    bulk_user_ignore_error: true

Example: Workflow Exporting Users

_export:
  td:
    database: sample_datasets

+export_to_sailthru:
  td>: queries/samples.sql
  result_connection: my_sailthru_connection
  result_settings:
    target: user
    user_key: email
    user_lists: '"My List": 1'
    user_keys_column: sms, sid
    user_vars_columns: name, dob
    user_keys_conflict_resolution: error
    user_optout_templates: '"My OptOut Template": 1'
    user_ignore_error: true

Example: Workflow Bulk Exporting Users

_export:
  td:
    database: sample_datasets

+export_to_sailthru:
  td>: queries/samples.sql
  result_connection: my_sailthru_connection
  result_settings:
    target: bulk_user
    bulk_user_key: email
    bulk_user_lists: '"My List": 1'
    bulk_user_keys_column: sms, sid
    bulk_user_vars_columns: name, dob
    bulk_user_ignore_error: true

For more information, see using data connectors in workflow to export data.


  • No labels