{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Mailpublisher Connector Via CLI","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"mailpublisher-connector-via-cli","__idx":0},"children":["Mailpublisher Connector Via CLI"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you prefer, you can use the connector via ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/data-workbench/workflows/treasure-workflow-quick-start-using-td-toolbelt-in-a-cli"},"children":["Treasure CLI"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open a terminal and run the following commands to install the newest ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-configuration-file","__idx":1},"children":["Create a Configuration File"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The configuration file includes an in: section where you specify what comes into the connector from your integration and an out: section where you specify what the connector puts out to the database in Treasure Data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare configuration file (for example, config.yml) as shown in the following example. Provide your integration account access information."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-configyml","__idx":2},"children":["Example (config.yml)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: mail_publisher_smart\n  site_id: mysite\n  login_id: foo\n  password: bar\n  data_type: list_status\n  file_ids: [1,2,3]\nfilters:\n- type: add_time\n  from_value:\n    mode: upload_time\n  to_column:\n    name: time\nout: type: td\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"authentication","__idx":3},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Specify ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["site_id"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["login_id"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["password."]}," You can obtain the credentials from the MailPublisher's console."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-type","__idx":4},"children":["Data type"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"email-list-status","__idx":5},"children":["Email List Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["list_status"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["data_type"]},", then specify ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["file_ids"]}," as list of file ID."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"article-status-and-click-count-status","__idx":6},"children":["Article Status and Click Count Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["article_status"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["click_count_list"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["data_type"]},", then specify ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["start_date"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["duration"]},". Set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["incremental"]}," if you want incremental loading."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: mail_publisher_smart\n  data_type: article_status\n  # data_type: click_count_list\n  start_date: 2018-10-01\n  duration: 1\n  incremental: true\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"optional-preview","__idx":7},"children":["(Optional) Preview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run td connector:preview command to validate your configuration file"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:preview config.yml\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"data-partition-key","__idx":8},"children":["Data Partition Key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Connector sessions need at least one timestamp column in result data to be used as data partition key and the first timestamp column is chosen as the key by default. Because the MailPublisher connector doesn't have any timestamp column in the result schema, append the \"",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["time"]},"\" column by adding the filter configuration as follows."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: mail_publisher_smart\n  ...\nfilters:\n- type: add_time\n  from_value:\n    mode: upload_time\n  to_column:\n    name: time\nout:\n  type: td\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-new-connector-session","__idx":9},"children":["Create New Connector Session"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run td connector:create."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With the following command, a daily import session with MailPublisher connector is created."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:create daily_mail_publisher_import \\\n    \"10 0 * * *\" td_sample_db td_sample_table config.yml\n","lang":"bash"},"children":[]}]},"headings":[{"value":"Mailpublisher Connector Via CLI","id":"mailpublisher-connector-via-cli","depth":1},{"value":"Create a Configuration File","id":"create-a-configuration-file","depth":2},{"value":"Example (config.yml)","id":"example-configyml","depth":3},{"value":"Authentication","id":"authentication","depth":3},{"value":"Data type","id":"data-type","depth":3},{"value":"Email List Status","id":"email-list-status","depth":4},{"value":"Article Status and Click Count Status","id":"article-status-and-click-count-status","depth":4},{"value":"(Optional) Preview","id":"optional-preview","depth":2},{"value":"Data Partition Key","id":"data-partition-key","depth":3},{"value":"Create New Connector Session","id":"create-new-connector-session","depth":2}],"frontmatter":{"seo":{"title":"Mailpublisher Connector Via CLI"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/mailpublisher-connector-via-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}