Introduction
Sailthru is delivered as a Software as a Service (SaaS) platform, which means you can access it via the Internet without the need for on-premises installations.
Features:
- Email Marketing: Sailthru provides tools for email marketing campaigns.
- Automation: You can automate marketing campaigns for efficiency.
- Personalization: The platform allows for personalizing email content to target specific audiences.
Multi-Channel Campaigns: Sailthru enables you to integrate your marketing efforts across various channels, including email, SMS, Twitter, and Facebook.
API: The platform offers a complete API, allowing for custom integrations and interactions with other systems and services.
Standard Integrations: Sailthru offers a suite of standard integrations with partners such as Magento, Google, Demandware, Shopify, and other web analytics and e-commerce providers.
Sailthru Dashboard
Dashboard: You can access the Sailthru dashboard for your specific accounts by visiting the URL provided (https://my.sailthru.com/) and logging in with your username and password.

Enter the login credentials (username and password) and click Login, which redirects to the dashboard page.

View All (Current) Lists:
To view the current lists associated with the account,
- Click the Users tab.
- Select the Lists option.
Lists Page: After selecting the Lists option, you are redirected to the Lists page. This page displays all the current lists linked to your account.

Create New List:
To create a new list,
- Click Create New List. After clicking this button, a popup appears.
- In the popup, enter the following information:
- Name for the List: Provide a unique name for the new list.
- Type of the List: Select the Primary or Secondary options.
- Click Create List.
- To view details of a specific list, click the name of the list.
- You are directed to a dashboard that displays details about the selected list, including email IDs, user engagement, and the date you added to the list.
Push Data Points Into Specific Lists (Ratings and Reviews)
For Ratings and Reviews (R&R) purposes, push the following data points into a specific Sailthru list:
- Rating Value
- Review Title
- Review Comment
- Username
- Rating Image Path
- Product Name
- Product Image URL
- Product URL
- Product Description
- Review Date
Sample Code:
/* First Include All Library Files */
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
require('_autoload.php');
$api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
$api_secret = "xxxxxxxxxxxxxxxxxxxx";
$client = new Sailthru_Client($api_key, $api_secret);
try {
//update existing user by email or create new user using email address
$response = $client->saveUser('Denee555.sa@gmail.com', array(
'key' => 'email',
'lists' => array(
'SA_Loyalty_Program' => 1 // optout from list -1
),
'vars' => array
(
'username'=> "Denis Crestin",
'lifetime_points' => 300,
'used_points' => 180,
'availabel_points' => 120
)
));
Print_r($response);
} catch (Sail_Client_Exception $e) {
// deal with exception
var_dump($e);
}
- The saveUser() method is used to update your details and push point data into a specific list.
- You must provide the following information:
- API Key: This is a unique identifier for the Sailthru account. It is used to authenticate the requests to the Sailthru API.
- API Secret: This is a secret key associated with the API Key. It is used for secure authentication and kept secret.
- Username: Enter the username or email address.
- Password: The password is required to authenticate and update your account information.
In addition to standard data points, you can also send any custom information based on the business requirements.
Send Triggered Emails
Step 1: Create an Email Template
Go to the Communications tab in Sailthru.

Select the Templates option.

Click on the New Template button.

Set the following parameters for the template:
- Template Name
- Template Type (email or SMS)
Click on the Create Template button.

The Template Editor allows you to manage the details of a template.
- Basics Tab: Configure sender information, subject, and tracking settings for the email templates. The specifics of how to set up these fields may vary depending on the email marketing platform or software.
- Public Name: The name that appears if you decide to opt out of receiving emails from this template. If left blank, it will default to the template's name.
- From Name: The name of the sender of the email. This is a person's name or a company name.
- From Email: The email address used as the sender's address when sending the email.
- Reply-To Email: The email address to which a recipient’s reply is sent by default.
- Subject: The subject line of the email. It should give recipients an idea of what the email is about and entice them to open it.
- Link Tracking: Select Yes to track the links included in the email template. Link tracking helps gather data on which links are clicked by recipients. This can be valuable for analyzing the effectiveness of email campaigns.
- Google Analytics: Select Yes to integrate Google Analytics with the email campaign. Google Analytics can provide additional insights into how recipients interact with the website after clicking links in the email.
-
Template Status: Select Active or Inactive.
-
Code Tab: You initially enter and edit the HTML code for the email template. You make changes to the HTML structure, add or modify text and images, and apply styling using CSS.
-
Preview Tab: After entering the HTML code for your email template, the Preview tab allows you to see how the HTML structure is designed.
- Text Version Tab: This is where you create or review the plain text version of the email. It's important to provide a plain text version of the code.
Step 2: Send Created Email Template
The following steps explain the flow of the APIs used in R&R to send this triggered email:
Step 1: Fetch the Sailthru flag (which is set in the ‘Advanced’ setting section of R&R site admin) from the DB table.
Step 2: If the Sailthru flag is set (i.e. Enable Saithru API is activated for the specific client), then fetch the API key, contact list ID, and other required parameters from the DB table.
Step 3: Connect with Sailthru by using the REST API with API key and API secret.
Step 4: Generate the session ID using the Sailthru login REST method.
Step 5: Fetch the Sailthru fields from the DB table.
Step 6: Create the following array.
array("rating_value"=>"5","review_title"=>"NICE PRODUCT","review_comment"=>
"NICE PRODUCT","name"=>"TEST","email"=>"test@test.com"
,"rating_image"=>"<RATING IMAGE PATH>","product_name"=>"ABC","product_image_url"=>
"<PRODUCT IMAGE PATH>","product_url"=>"<PRODUCT URL>",
"product_description"=>"<PRODUCT DESCRIPTION>","review_date"=>
<REVIEW SUBMISSION/APPROVAL DATE>);
Step 7: Check if the contact is present in Sailthru. If the contact exists in Sailthru, then update the field data. If not, store the new contact in the contact list ID and set the field data value against the contact.
Methods Used:
For Add or Update Contact: saveUser();
Step 8: Check the Template created in Sailthru by Email Template Name, which is set in the RNR site admin setting section.
Step 9: If the Email Template is present in Sailthru, send the specific email by following the REST Method.
The method used: send()
Sample Code for sending email:
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
require('_autoload.php');
$api_key = "xxxxxxxxxxxxxxxxxxxxx";
$api_secret = "xxxxxxxxxxxxxxxxxxxxxxx";
$client = new Sailthru_Client($api_key, $api_secret);
try {
//update existing user by email or create new user using email address
$template="PASS TEMPLATE NAME";
$email="tommarsh.sa@gmail.com";
$vars = array
(("rating_value"=>"5","review_title"=>"NICE PRODUCT","review_comment"=>
"NICE PRODUCT","name"=>"TEST","email"=>"test@test.com"
,"rating_image"=>"<RATING IMAGE PATH>","product_name"=>"ABC","product_image_url"=>
"<PRODUCT IMAGE PATH>","product_url"=>"<PRODUCT URL>",
"product_description"=>"<PRODUCT DESCRIPTION>","review_date"=>
<REVIEW SUBMISSION/APPROVAL DATE>);
$options = array();
$schedule_time = "now";
$response = $client->send($template, $email, $vars, $options, $schedule_time);
Print_r($response);
} catch (Sail_Client_Exception $e) {
// deal with exception
var_dump($e);
}
To send this triggered email, we need to pass the following parameters:
- API key
- API secret
- Template name
- Username
- Password