Learn more about EmberPoint MailPublisher Import Integration.

Treasure Data can publish segments into EmberPoint MailPublisher, enabling you to send personalized emails. You can run data-driven email campaigns, using your first party data from Web, Mobile, CRM, and so on.

You can use this same connector to import MailPublisher data into Treasure Data.

Restrictions on MailPublisher Smart Email Delivery List Data

MailPublisher Smart have some restrictions for the column name in delivery list data.

  • The first column name must be an "email"

  • Column name must not contain reserved words

    • image_[number] e.g. image_001

    • linkurl_[number] e.g. linkurl_001

    • cvurl_[number] e.g. cvurl_001

    • boundary[number] e.g. boundary00

    • carrier_type

    • code_mini

  • Column name must not contain below characters

    • "-" (hyphen) and " " (space)

  • Column value can't contain "," (comma), '"' (double quote) and new line (CR/LF/CRLF) for now.

  • Column value must not contain special characters such as IBM extended (ja: IBM拡張), NEC extended kanji (ja: NEC拡張漢字), number enclosed within a circle (ja: 丸数字) like ①.

  • Email string in column value must have a valid format. Invalid formatted email addresses will be removed when you upload email delivery list.

Upload file will be encoded with Shift_JIS character encoding when you choose "Japan" for the destination. Some character text might get garbled at that time.

Refer "MailPublisher Smart manual to cooperate with external system (ja: 外部システムとの連携利用マニュアル)" and "MailPublisher Smart function manual (ja: 機能説明マニュアル)". You can download both of them from MailPublisher Smart console.

Prerequisites

  • Basic knowledge of Treasure Data, including the Toolbelt.

  • A MailPublisher Smart Account with API access enabled (done via MailPublisher Smart Console).

MailPublisher Smart Account Information

Access to your API-enabled account is required before you can upload the email delivery list. The Site ID can be retrieved from the MailPublisher Smart console.

Steps to enable and create a new account for API access

  1. Select Account > Create (ja: アカウント > 新規作成) in left menu

  2. Create an external system cooperation type User (ja: 利用種別:外部システム連携).



Getting a Draft ID

To use "send_email" option, you need to get draft ID which is seen on here (メール配信・一覧 > 下書きメール).


Use the TD Console to Create Your Connection

Create a New Connection

When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and then specify the source information.

  1. Open TD Console.

  2. Navigate to Integrations Hub >  Catalog

  3. Search for and select MailPublisher.
    The following dialog opens.


  4. Complete the new connection information, providing your MailPublisher Smart credential.

    • MailPublisher Smart Site ID (required): This is your MailPublisher Smart Site ID.

    • MailPublisher Smart Login ID (required): This is service specific Login ID.

    • MailPublisher Smart password (required): This is password for above Login ID.

    • Retry limit (optional, default 7): Number of retries before the connector stops trying to connect and send data out

    • Maximum intervals in milliseconds between retries (optional, default to 120000) : Maximum time in milliseconds between retrying attempts.

    • Initial intervals in milliseconds between retries (optional, default 15000): Interval to retry if a recoverable error happens (in millisecond).

      • MailPublisher Smart announces minimal retry interval time should be 15 sec (15000 ms).

    • Timeout (optional, default to 100000) : Timeout for each HTTP request in milliseconds.

Name Your Connection

  1. Type a name for your connection.

  2. Select Done.


Define your Query

  • The column name is case-insensitive. For example, you can use email or EMAIL.


  1. Complete the instructions in Creating a Destination Integration.
  2. Navigate to Data Workbench > Queries.

  3. Select a query for which you would like to export data.

  4. Run the query to validate the result set.

  5. Select Export Results.

  6. Select an existing integration authentication.
  7. Define any additional Export Results details. In your export integration content review the integration parameters.
    For example, your Export Results screen might be different, or you might not have additional details to fill out:
  8. Select Done.

  9. Run your query.

  10. Validate that your data moved to the destination you specified.

Example Query

  1. Navigate to Data Workbench > Queries.

  2. Select New Query or search for the query you want to use.

  3. Review the following sample queries:

    SELECT
      email,
      td_global_id as tdglobalid,
      firstname,
      lastname,
      company
    FROM (
      VALUES
        ('name+test1@treasure-data.com', 'b1b065f5-1222-4a14-b151-379d49ec39e3', 'John', 'Doe', 'MailPublisher Dummy Data - DO NOT USE'),
        ('name+test2@treasure-data.com', 'x1b065f5-1222-4a14-b151-379d49ec39e3', 'Janes', 'Doe', 'MailPublisher Dummy Data - DO NOT USE'),
        ('name+test3@treasure-data.com', 'p1b065f5-1222-4a14-b151-379d49ec39e3', 'Tony', 'Doe', 'MailPublisher Dummy Data - DO NOT USE'),
        ('name+test4@treasure-data.com', 'o1b065f5-1222-4a14-b151-379d49ec39e3', 'Bill', 'Adam', 'MailPublisher Dummy Data - DO NOT USE'),
        ('name+test5@treasure-data.com', 't1b065f5-1222-4a14-b151-379d49ec39e3', 'Dan', 'Steve', 'MailPublisher Dummy Data- DO NOT USE')
      ) tbl
    (
      email,
      td_global_id,
      firstname,
      lastname,
      company
    )

    or

    SELECT an_email_column AS email,
    another_phone_column AS phone
    FROM your_table;
  4. Select Export Results.

  5. Use an existing integration and select your MailPublisher connection.

  6. Complete the following parameter fields:

  • Action mode:

    • list_upload: Upload a distribution list

    • send_email: Book an email delivery in addition to uploading the list

  • Email delivery destination:

    • Japan or Worldwide

    • The uploaded file is encoded with Shift_JIS character encoding if the destination is "Japan", otherwise, the file is encoded with UTF-8.

  • File name prefix: (optional, default: "delivery_list_") : The uploaded file will have this prefix in its file name.

  • Draft ID: (required with "send_email" mode) An ID of a draft to use email delivery, which can be checked on MailPublisher's console.

  • Use immediate email delivery: Check if you want to send an email immediately

    • Be careful when using this option, email delivery settings cannot be tested at this stage.

  • Booking date time: (required unless "immediate delivery" mode) Send an email at this time. It would be at least 10 minutes after the time to run the output job. Its format must be "YYYY-MM-DD HH:mm" such as "2018-09-18 12:00"

  • Booking timezone: Timezone for booking date time


Optionally Schedule the Query Export Jobs

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


1. Navigate to Data Workbench > Queries.
2. Create a new query or select an existing query.
3. Next to Schedule, select None.

4. In the drop-down, select one of the following schedule options.

Drop-down ValueDescription
Custom cron...

Review Custom cron... details.

@daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
@hourly (:00)Run every hour at 00 minutes.
NoneNo schedule.

Custom cron... Details

Cron Value

Description

0 * * * *

Run once an hour

0 0 * * *

Run once a day at midnight

0 0 1 * *

Run once a month at midnight on the morning of the first day of the month

""

Create a job that has no scheduled run time.

 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat

  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec

A single space is required between each field. The values for each field can be composed of:

Field ValueExampleExample Description

a single value, within the limits displayed above for each field.



a wildcard ‘*’ to indicate no restriction based on the field. 

‘0 0 1 * *’ configures the schedule to run at midnight (00:00) on the first day of each month.
a range ‘2-5’, indicating the range of accepted values for the field.‘0 0 1-10 * *’ configures the schedule to run at midnight (00:00) on the first 10 days of each month.
a list of comma-separated values ‘2,3,4,5’, indicating the list of accepted values for the field.

0 0 1,11,21 * *’


configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
a periodicity indicator ‘*/5’ to express how often based on the field’s valid range of values a schedule is allowed to run.

‘30 */2 1 * *’


configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. ‘0 0 */5 * *’ configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
a comma-separated list of any of the above except the ‘*’ wildcard is also supported ‘2,*/5,8-10’‘0 0 5,*/10,25 * *’configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
5.  (Optional) If you enabled the Delay execution, you can delay the start time of a query.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically imported to the specified container destination.


Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.


  1. Review results in the MailPublisher Smart Console for your new email delivery list.

Optionally Configure Export Results in Workflow

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

Learn more at Using Workflows to Export Data with the TD Toolbelt.


  • No labels