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 (Visual Commerce)
For Visual Commerce (VC) purposes, push the following data points into a specific Sailthru list:
- Username
- Product code
- Photo URL
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
- Determine the specific condition that triggers the email.
- Use Sailthru REST APIs to send the email template.
- Sample Code:
<?php
//echo "welcome";
error_reporting(E_ALL); ini_set('display_errors', 1);
require('_autoload.php'); //echo "welcome 1";
$api_key = "xxxxxxxxxxxxxxxxxxx";
$api_secret = "xxxxxxxxxxxxxxxxxxxx";
$client = new Sailthru_Client($api_key, $api_secret);
//echo "welcome 2";
//This function is used to send trigger email
public function sendtriggeremail() {
if (count($this->associatePhotoUrlResults) > 0) {
$photourlarrtemp = array();
$defaulimgturl = "http://socialannexprod.blob.core.windows.net/9991331/ JWPV4YOICCJWphpV7GS3c.jpeg";
$client = new Sailthru_Client($this->api_key, $this->api_secret);
$template = "SA-VC Photo Product Associated";
$vars = array
(
'email' => $this->email, 'productcode' => $this->productcode
);
$associmg = $this->associatePhotoUrlResults;
$limit = $this->image_limit;
for ($i = 1; $i <= $limit; $i++) {
$imgurl = (!empty($associmg[$i])) ? $associmg[$i] : $defaulimgturl;
$photourlarrtemp[] = $imgurl;
$vars['photourl' . $i] = $imgurl;
}
$options = array();
$schedule_time = "now";
if ($this->debug == 200) {
echo "<pre>Var ==>";
print_r($vars);
die();
}
$response = $client-> send($template, $this->email, $vars, $options, $schedule_time);
if ($this->debug == 201) {
echo "<pre>Response ==>";
print_r($response);
die();
}
$this->responseinfo($response);
//Push Data into list
if (count($photourlarrtemp) > 0) {
$photourl = implode('^', $photourlarrtemp);
$this->pushDataIntoList($photourl); }
} else {
echo json_encode(array("error" => "File is empty. !!!!"));
die();
}
}
Note: In the above code, the Image limit is set to three.
- Use the send() method to send the triggered email.
- Pass the following parameters:
- API key
- API secret
- Username
- Password
- Product code
- Image limit