This plugin is recommended for large data sets.
Alternatively, you can use Salesforce Marketing Cloud (ExactTarget) Data Connector for small data sets, to write job results.
Arm Treasure Data can publish user segments into Salesforce Marketing Cloud (ExactTarget), and enable you to send personalized emails to your customers. You can run data-driven email campaigns, by using your first party data from Web, Mobile, CRM, and other data sources.
- Basic knowledge of Treasure Data
- Basic knowledge of Salesforce Marketing Cloud
- TD account
Set up a secure, automated account in Salesforce
Access your Salesforce account to begin set up.
Create an FTP account
On the SFMC dashboard, in your account, click Administration.
From the Account drop-down menu, click FTP Accounts. This allows you to establish an SFTP account.
In the FTP Accounts pane, click Add FTP User.
Provide an FTP account password.
Review your SFTP account information.
Configure for automatic mail delivery
Go back to the SFMC dashboard, and click Email Studio > Email.
Click Content > Create > Template > From Existing Template to create an email template.
After creating the template, click Save > Save and Exit and then provide a template name and location, and save that information as well.
Remaining on the Email page, click Create > Email to create email content (for example, for a campaign) from a template.
Select the template, define the email properties, including name and location, and click Next to provide content. Continue creating the email and save when you are finished.
Define specification for import into Salesforce
Create an Import Interaction in Salesforce
While still in the Email view, from the Interactions drop-down menu, click Import.
Click Create to make a new import interaction definition.
Provide the import interaction information, including SFTP information and data import location. Save the information.
Specify the import trigger
While still in the Email view, click on the SFDC blue cloud icon to view menu options.
Click Journey Builder > Automation Studio.
Click New Automation.
Drag the File Drop icon to Starting Source.
Click Configure> Trigger Automation.
Specify Use Filename Pattern and then click Done.
Drag the Send Email icon to the canvas and click Create New.
Select an email object, for example, the one you created in this section. Click Next. Select an email target list. Click Next. Verify the email configuration information, and click Finish.
Provide a name for the import trigger and an external key that is referred to by Treasure Data, and click Save.
Click Active to enable the import trigger.
Click Save and Close.
Run a Treasure Data job to complete an initial import to Salesforce
Create a job that selects data from within Treasure Data. The specified column name for the mapping must match the column name in the SFMC Exact Target mail. “Email Address” and “Subscriber Key” columns are required. If needed, you can change the mapped column name that is in TD database. You can change the column name from within the TD console.
Before running the job, you choose an existing data connection or create your data connector for export.
Click Export Results in the upper right corner of the query editor and in the pane, either search for an existing data connector or click New Integration to create a data connector.
Create a Connection
When you click new integration you see the following dialog that enables an authenticated connection:
Enter the required credentials for your remote SFTP instance. Name the connection. If you would like to share this connection with other users in your organization, check the
Share with others checkbox. If this box is unchecked this connection is visible only to you. Set the following parameters:
- Authentication mode: The way you choose to authenticate with your SFTP server.
- Host: The host information of the remote SFTP instance, for example an IP address.
- Port: The connection port on the remote FTP instance, the default is 22.
- User: The user name used to connect to the remote FTP instance.
- Secret key file: Required if 'public / private key pair' is selected from `Authentication Mode`.
- Passphrase for secret key file: (Optional) If required, provide a passphrase for the provided secret file.
- Retry limit: Number of times to retry a failed connection (default 10).
- Timeout: Connection timeout in seconds (default 600).
- Use proxy: Select if your network is using a proxy.
- Sequence format: Format for sequence part of output files (string, default:
You could specify more parameters for the target export file:
- Path prefix: the path for plugin to save your output files in the target server
- Rename file after upload finish: select to try to upload the file with .tmp extension first, then rename the file without .tmp when the file is uploaded successfully
- Format: format of the file (would be csv or tsv)
- Compression: choose it whenever you would like to compress the file. We support gzip and bzip2 compression
- Header line: choose it if you would like to write the first line as columns' name
- Delimiter: delimiter between values in the target file, would be | or tab or comma
- Quote policy: quote between each columns, could be MINIMUM, ALL or NONE
- Null string: the value for null field in the query
- End-of-line character: the character to specify for end of line. Would be Carriage Return Line Feed (CRLF - used in Windows OS file systems) or Line Feed (LF - used in Unix, MacOS) or Carriage Return (CR - used in classic MacOS)
- Encryption column names: list of encryption columns, separated by comma
- Encryption key: specify key needed to perform the encryption algorithm
- Encryption iv: specify a number to prevent repetition in data encryption
After configuring the output connector, and running a query, the query results are written to the target file server of SFMC.
Optional: Use of Scheduled Jobs for Output
You can use Scheduled Jobs with Result Output, to periodically write the output result to a target destination that you specify.
Optional: Configure Export Results in Workflow
Within Treasure Workflow, you can specify the use of this SFTP to output data.
Click here for more information on using data connectors in workflow to export data.
In the connection configuration, specify the SFTP account that you configured in SFMC.
Run the job
Run the query with the specified connector.
After the job finishes, you can check the output file on the SFTP server by using the general SFTP command, as shown in the following example:
Check the SFMC dashboard to verify a successful import. If the import and mail delivery is successful, you can see Complete on the Automation Studio Overview page.