PHP Class Sailthru_Client

Exibir arquivo Open project: sailthru/sailthru-php5-client Class Usage Examples

Protected Properties

Property Type Description
$api_key string Sailthru API Key
$api_uri string Sailthru API URL, can be different for different users according to their settings
$http_request_type string cURL or non-cURL request
$secret string Sailthru Secret
$user_agent_string String User agent making request to Sailthru API server Even, if you modify user-agent, please try to include 'PHP5' somewhere in the user-agent

Public Methods

Method Description
__construct ( string $api_key, string $secret, string $api_uri = false, array $options = null ) Instantiate a new client; constructor optionally takes overrides for api_uri and whether to share the version of PHP that is being used.
apiDelete ( string $action, array $data, $options = [] ) : array Perform an API DELETE request, using the shared-secret auth hash.
apiGet ( string $action, array $data = [], $method = 'GET', $options = [] ) : array Perform an API GET request, using the shared-secret auth hash.
apiPost ( string $action, array $data, array $binary_data_param = [], array $options = [] ) : array Perform an API POST (or other) request, using the shared-secret auth hash.
cancelBlast ( $blast_id ) : array Cancel a scheduled Blast
cancelSend ( string $send_id ) : array Cancel a send that was scheduled for a future time.
deleteAlert ( $email, $alert_id ) : array Remove an alert from a user's settings.
deleteBlast ( $blast_id ) : array Delete Blast
deleteList ( string $list ) : array Deletes a list.
deleteTemplate ( string $template_name ) : array Delete a template.
getAlert ( String $email ) : array Retrieve a user's alert settings.
getBlast ( $blast_id ) : array Get Blast information
getBlasts ( array $options ) : array Get info on multiple blasts
getConnectTimeout ( )
getEmail ( string $email, array $options = [] ) : array Return information about an email address, including replacement vars and lists.
getInclude ( string $include_name, array $options = [] ) : array Fetch information about an include
getIncludes ( ) : array Fetch name of all existing includes
getJobStatus ( String $job_id ) : array Get status of a job
getLastRateLimitInfo ( string $action, string $method ) : array get the rate limit information for the very last call with given action and method
getLastResponseInfo ( ) : array get information from last server response when used with cURL returns associative array as per http://us.php.net/curl_getinfo
getList ( string $list ) : array Get information about a list.
getLists ( ) : array Get information about all lists
getSend ( string $send_id ) : array Get the status of a send.
getTemplate ( string $template_name, array $options = [] ) : array Fetch information about a template
getTemplateFromRevision ( $revision_id )
getTemplates ( ) : array Fetch name of all existing templates
getTimeout ( )
getTriggerByEvent ( string $event ) : array Get information on a trigger
getTriggerById ( string $trigger_id ) : array Get information on a trigger
getTriggerByTemplate ( string $template, string $trigger_id = null ) : array Get information on a trigger
getTriggers ( ) : array Get Triggers
getUserByKey ( String $id, String $key, array $fields = [] ) : array Get user by specified key
getUserBySid ( String $id ) : array Get user by Sailthru ID
multisend ( string $template_name, array $emails, array $vars = [], array $evars = [], array $options = [] ) : array Remotely send an email template to multiple email addresses.
postEvent ( string $id, string $event, array $options = [] ) : array Notify Sailthru of an event
postEventTrigger ( string $event, integer $time, string $time_unit, string $zephyr ) : array Create a trigger for events
postTrigger ( string $template, integer $time, string $time_unit, string $event, string $zephyr ) : array Create a trigger for templates
previewBlastWithEmail ( $blast_id, $send_email ) : array Get an email preview of a blast.
previewBlastWithHTML ( $blast_id, $email ) : array Get an HTML preview of a blast.
previewContentWithEmail ( $content_html, $send_email ) : array Get an email preview of content_html.
previewContentWithHTML ( $content_html, $email ) : array Get an HTML preview of content_html.
previewRecurringBlastWithEmail ( $blast_repeat_id, $send_email ) : array Get an email preview of a recurring blast.
previewRecurringBlastWithHTML ( $blast_repeat_id, $email ) : array Get an HTML preview of a recurring blast.
previewTemplateWithEmail ( $template, $send_email ) : array Get an email preview of a template.
previewTemplateWithHTML ( $template, $email ) : array Get an HTML preview of a template.
processBlastQueryJob ( integer $blast_id, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Export blast data in CSV format
processExportListJob ( String $list, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Process a export list job
processImportJob ( String $list, String $emails, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Process import job from given email string CSV
processImportJobFromFile ( String $list, $file_path, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Process import job from given file path of a CSV or email per line file
processPurchaseImportJobFromFile ( String $file_path, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Process purchase import job from given file path of an email per line JSON file
processSnapshotJob ( array $query, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Process a snapshot job
processUpdateJob ( String $context, $value, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $file_params = [], array $options = [] ) : array Perform a bulk update of any number of user profiles from given context: String CSV, file, URL or query
processUpdateJobFromEmails ( String $emails, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Perform a bulk update of any number of user profiles from emails CSV
processUpdateJobFromFile ( $file, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Perform a bulk update of any number of user profiles from given file
processUpdateJobFromQuery ( Array $query, array $update = [], String $report_email = false, String $postback_url = false, array $options = [] ) Perform a bulk update of any number of user profiles from a query
processUpdateJobFromUrl ( String $url, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array Perform a bulk update of any number of user profiles from given URL
purchase ( $email, array $items, $incomplete = null, $message_id = null, array $options = [] ) : array Record that a user has made a purchase, or has added items to their purchase total.
purchaseIncomplete ( $email, array $items, $message_id, array $options = [] ) : array Make a purchase API call with incomplete flag
pushContent ( String $title, String $url, String $date = null, Mixed $tags = null, $vars = [], $options = [] ) : array Push a new piece of content to Sailthru, triggering any applicable alerts.
receiveHardBouncePost ( ) : boolean Hard bounce postbacks
receiveOptoutPost ( ) : boolean Optout postbacks
receiveUpdatePost ( ) : boolean Update postbacks
receiveVerifyPost ( ) : boolean Returns true if the incoming request is an authenticated verify post.
saveAlert ( String $email, String $type, String $template, String $when = null, array $options = [] ) : array Add a new alert to a user. You can add either a realtime or a summary alert (daily/weekly).
saveInclude ( string $include_name, array $include_fields = [] ) : array Save an include
saveList ( string $list, string $type = null, boolean $primary = null, array $query = [] ) : array Create a list, or update a list.
saveTemplate ( string $template_name, array $template_fields = [] ) : array Save a template.
saveTemplateFromRevision ( string $template_name, $revision_id ) : array Save a template from revision
saveUser ( String $id, array $options = [] ) : array Save existing user
scheduleBlast ( string $name, string $list, string $schedule_time, string $from_name, string $from_email, string $subject, string $content_html, string $content_text, array $options = [] ) : array Schedule a mass mail blast
scheduleBlastFromBlast ( String | integer $blast_id, String $schedule_time, array $options = [] ) : array Schedule a mass mail blast from previous blast
scheduleBlastFromTemplate ( String $template, String $list, String $schedule_time, array $options = [] ) : array Schedule a mass mail from a template
send ( string $template, string $email, array $vars = [], array $options = [], string $schedule_time = null ) : array Remotely send an email template to a single email address.
setEmail ( string $email, array $vars = [], array $lists = [], array $templates = [], integer $verified, string $optout = null, string $send = null, array $send_vars = [] ) : array Set replacement vars and/or list subscriptions for an email address.
setEmail2 ( $email, array $options = [] ) : array Update / add email address
setHorizonCookie ( string $email, string $domain = null, integer $duration = null, boolean $secure = false ) : boolean Set Horizon cookie
setHttpHeaders ( array $headers )
stats ( array $data ) : array Make Stats API Request
stats_blast ( $blast_id = null, $start_date = null, $end_date = null, array $data = [] ) : array Retrieve information about a particular blast or aggregated information from all of blasts over a specified date range.
stats_list ( String $list = null, String $date = null ) : array Retrieve information about your subscriber counts on a particular list, on a particular day.
stats_send ( $template = null, $start_date = null, $end_date = null, array $data = [] ) : array Retrieve information about a particular send or aggregated information from all of templates over a specified date range.
updateBlast ( $blast_id, string $name = null, string $list = null, string $schedule_time = null, string $from_name = null, string $from_email = null, string $subject = null, string $content_html = null, string $content_text = null, array $options = [] ) : array updates existing blast

Protected Methods

Method Description
httpRequest ( $action, array $data, string $method = 'POST', array $options = [] ) : string Perform an HTTP request, checking for curl extension support
httpRequestCurl ( string $action, array $data, string $method = 'POST', array $options = [] ) : string Perform an HTTP request using the curl extension
httpRequestWithoutCurl ( string $action, array $data, string $method = 'POST', array $options = [] ) : string Adapted from: http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
prepareJsonPayload ( array $data, array $binary_data = [] ) Prepare JSON payload
processJob ( String $job, array $data = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $binary_data_param = [], array $options = [] ) : array process job api call

Private Methods

Method Description
parseRateLimitHeaders ( string $headers ) : array | null parse rate limit headers from http response

Method Details

__construct() public method

Instantiate a new client; constructor optionally takes overrides for api_uri and whether to share the version of PHP that is being used.
public __construct ( string $api_key, string $secret, string $api_uri = false, array $options = null )
$api_key string
$secret string
$api_uri string
$options array - optional parameters for connect/read timeout

apiDelete() public method

Perform an API DELETE request, using the shared-secret auth hash.
public apiDelete ( string $action, array $data, $options = [] ) : array
$action string
$data array
return array

apiGet() public method

Perform an API GET request, using the shared-secret auth hash.
public apiGet ( string $action, array $data = [], $method = 'GET', $options = [] ) : array
$action string
$data array
return array

apiPost() public method

if binary_data_param is set, its appends '@' so that cURL can make binary POST request
public apiPost ( string $action, array $data, array $binary_data_param = [], array $options = [] ) : array
$action string
$data array
$binary_data_param array
$options array
return array

cancelBlast() public method

Cancel a scheduled Blast
public cancelBlast ( $blast_id ) : array
return array API result

cancelSend() public method

Cancel a send that was scheduled for a future time.
public cancelSend ( string $send_id ) : array
$send_id string
return array API result

deleteAlert() public method

Remove an alert from a user's settings.
public deleteAlert ( $email, $alert_id ) : array
$email
$alert_id
return array API result

deleteBlast() public method

Delete Blast
public deleteBlast ( $blast_id ) : array
return array API result

deleteList() public method

Deletes a list.
public deleteList ( string $list ) : array
$list string
return array

deleteTemplate() public method

Delete a template.
public deleteTemplate ( string $template_name ) : array
$template_name string
return array API result

getAlert() public method

Retrieve a user's alert settings.
public getAlert ( String $email ) : array
$email String
return array API result

getBlast() public method

Get Blast information
public getBlast ( $blast_id ) : array
return array API result

getBlasts() public method

Get info on multiple blasts
public getBlasts ( array $options ) : array
$options array associative array start_date (required) end-date (required) status
return array API result

getConnectTimeout() public method

public getConnectTimeout ( )

getEmail() public method

Return information about an email address, including replacement vars and lists.
public getEmail ( string $email, array $options = [] ) : array
$email string
$options array
return array API result

getInclude() public method

Fetch information about an include
public getInclude ( string $include_name, array $options = [] ) : array
$include_name string
$options array
return array API result

getIncludes() public method

Fetch name of all existing includes
public getIncludes ( ) : array
return array API result

getJobStatus() public method

Get status of a job
public getJobStatus ( String $job_id ) : array
$job_id String
return array

getLastRateLimitInfo() public method

get the rate limit information for the very last call with given action and method
public getLastRateLimitInfo ( string $action, string $method ) : array
$action string
$method string GET, POST or DELETE
return array or null

getLastResponseInfo() public method

get information from last server response when used with cURL returns associative array as per http://us.php.net/curl_getinfo
public getLastResponseInfo ( ) : array
return array or null

getList() public method

Get information about a list.
public getList ( string $list ) : array
$list string
return array

getLists() public method

Get information about all lists
public getLists ( ) : array
return array

getSend() public method

Get the status of a send.
public getSend ( string $send_id ) : array
$send_id string
return array API result

getTemplate() public method

Fetch information about a template
public getTemplate ( string $template_name, array $options = [] ) : array
$template_name string
$options array
return array API result

getTemplateFromRevision() public method

public getTemplateFromRevision ( $revision_id )

getTemplates() public method

Fetch name of all existing templates
public getTemplates ( ) : array
return array API result

getTimeout() public method

public getTimeout ( )

getTriggerByEvent() public method

Get information on a trigger
public getTriggerByEvent ( string $event ) : array
$event string
return array

getTriggerById() public method

Get information on a trigger
public getTriggerById ( string $trigger_id ) : array
$trigger_id string
return array

getTriggerByTemplate() public method

Get information on a trigger
public getTriggerByTemplate ( string $template, string $trigger_id = null ) : array
$template string
$trigger_id string
return array

getTriggers() public method

Get Triggers
public getTriggers ( ) : array
return array

getUserByKey() public method

Get user by specified key
public getUserByKey ( String $id, String $key, array $fields = [] ) : array
$id String
$key String
$fields array
return array

getUserBySid() public method

Get user by Sailthru ID
public getUserBySid ( String $id ) : array
$id String
return array

httpRequest() protected method

Perform an HTTP request, checking for curl extension support
protected httpRequest ( $action, array $data, string $method = 'POST', array $options = [] ) : string
$action
$data array
$method string
$options array
return string

httpRequestCurl() protected method

Perform an HTTP request using the curl extension
protected httpRequestCurl ( string $action, array $data, string $method = 'POST', array $options = [] ) : string
$action string
$data array
$method string
$options array
return string

httpRequestWithoutCurl() protected method

Adapted from: http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
protected httpRequestWithoutCurl ( string $action, array $data, string $method = 'POST', array $options = [] ) : string
$action string
$data array
$method string
$options array
return string

multisend() public method

Use the evars parameter to set replacement vars for a particular email address.
public multisend ( string $template_name, array $emails, array $vars = [], array $evars = [], array $options = [] ) : array
$template_name string
$emails array
$vars array
$evars array
$options array
return array API result

postEvent() public method

Notify Sailthru of an event
public postEvent ( string $id, string $event, array $options = [] ) : array
$id string
$event string
$options array
return array

postEventTrigger() public method

Create a trigger for events
public postEventTrigger ( string $event, integer $time, string $time_unit, string $zephyr ) : array
$event string
$time integer
$time_unit string
$zephyr string
return array

postTrigger() public method

Create a trigger for templates
public postTrigger ( string $template, integer $time, string $time_unit, string $event, string $zephyr ) : array
$template string
$time integer
$time_unit string
$event string
$zephyr string
return array

prepareJsonPayload() protected method

Prepare JSON payload
protected prepareJsonPayload ( array $data, array $binary_data = [] )
$data array
$binary_data array

previewBlastWithEmail() public method

Get an email preview of a blast.
public previewBlastWithEmail ( $blast_id, $send_email ) : array
$blast_id
$send_email
return array

previewBlastWithHTML() public method

Get an HTML preview of a blast.
public previewBlastWithHTML ( $blast_id, $email ) : array
$blast_id
$email
return array

previewContentWithEmail() public method

Get an email preview of content_html.
public previewContentWithEmail ( $content_html, $send_email ) : array
$content_html
$send_email
return array

previewContentWithHTML() public method

Get an HTML preview of content_html.
public previewContentWithHTML ( $content_html, $email ) : array
$content_html
$email
return array

previewRecurringBlastWithEmail() public method

Get an email preview of a recurring blast.
public previewRecurringBlastWithEmail ( $blast_repeat_id, $send_email ) : array
$blast_repeat_id
$send_email
return array

previewRecurringBlastWithHTML() public method

Get an HTML preview of a recurring blast.
public previewRecurringBlastWithHTML ( $blast_repeat_id, $email ) : array
$blast_repeat_id
$email
return array

previewTemplateWithEmail() public method

Get an email preview of a template.
public previewTemplateWithEmail ( $template, $send_email ) : array
$template
$send_email
return array

previewTemplateWithHTML() public method

Get an HTML preview of a template.
public previewTemplateWithHTML ( $template, $email ) : array
$template
$email
return array

processBlastQueryJob() public method

Export blast data in CSV format
public processBlastQueryJob ( integer $blast_id, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$blast_id integer
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processExportListJob() public method

Process a export list job
public processExportListJob ( String $list, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$list String
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processImportJob() public method

Process import job from given email string CSV
public processImportJob ( String $list, String $emails, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$list String
$emails String
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processImportJobFromFile() public method

Process import job from given file path of a CSV or email per line file
public processImportJobFromFile ( String $list, $file_path, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$list String
$file_path
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processJob() protected method

process job api call
protected processJob ( String $job, array $data = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $binary_data_param = [], array $options = [] ) : array
$job String
$data array
$report_email boolean | String
$postback_url boolean | String
$binary_data_param array
$options array
return array

processPurchaseImportJobFromFile() public method

Process purchase import job from given file path of an email per line JSON file
public processPurchaseImportJobFromFile ( String $file_path, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$file_path String
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processSnapshotJob() public method

Process a snapshot job
public processSnapshotJob ( array $query, boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$query array
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processUpdateJob() public method

Perform a bulk update of any number of user profiles from given context: String CSV, file, URL or query
public processUpdateJob ( String $context, $value, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $file_params = [], array $options = [] ) : array
$context String
$value
$update array
$report_email boolean | String
$postback_url boolean | String
$file_params array
$options array
return array

processUpdateJobFromEmails() public method

Perform a bulk update of any number of user profiles from emails CSV
public processUpdateJobFromEmails ( String $emails, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$emails String
$update array
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processUpdateJobFromFile() public method

Perform a bulk update of any number of user profiles from given file
public processUpdateJobFromFile ( $file, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$file
$update array
$report_email boolean | String
$postback_url boolean | String
$options array
return array

processUpdateJobFromQuery() public method

Perform a bulk update of any number of user profiles from a query
public processUpdateJobFromQuery ( Array $query, array $update = [], String $report_email = false, String $postback_url = false, array $options = [] )
$query Array
$update array
$report_email String
$postback_url String
$options array

processUpdateJobFromUrl() public method

Perform a bulk update of any number of user profiles from given URL
public processUpdateJobFromUrl ( String $url, array $update = [], boolean | String $report_email = false, boolean | String $postback_url = false, array $options = [] ) : array
$url String
$update array
$report_email boolean | String
$postback_url boolean | String
$options array
return array

purchase() public method

Record that a user has made a purchase, or has added items to their purchase total.
public purchase ( $email, array $items, $incomplete = null, $message_id = null, array $options = [] ) : array
$items array
$options array
return array API result

purchaseIncomplete() public method

Make a purchase API call with incomplete flag
public purchaseIncomplete ( $email, array $items, $message_id, array $options = [] ) : array
$items array
$options array
return array API result

pushContent() public method

Push a new piece of content to Sailthru, triggering any applicable alerts.
public pushContent ( String $title, String $url, String $date = null, Mixed $tags = null, $vars = [], $options = [] ) : array
$title String
$url String
$date String
$tags Mixed Null for empty values, or String or arrays
return array API result

receiveHardBouncePost() public method

Hard bounce postbacks
public receiveHardBouncePost ( ) : boolean
return boolean

receiveOptoutPost() public method

Optout postbacks
public receiveOptoutPost ( ) : boolean
return boolean

receiveUpdatePost() public method

Update postbacks
public receiveUpdatePost ( ) : boolean
return boolean

receiveVerifyPost() public method

Returns true if the incoming request is an authenticated verify post.
public receiveVerifyPost ( ) : boolean
return boolean

saveAlert() public method

$when is only required when alert type is weekly or daily array( 'type' => array('shoes', 'shirts'), 'min' => array('price' => 3000), 'tags' => array('blue', 'red'), ) ); $response = $sailthruClient->saveAlert("[email protected]", 'realtime', 'default', null, $options); ?>
public saveAlert ( String $email, String $type, String $template, String $when = null, array $options = [] ) : array
$email String
$type String
$template String
$when String
$options array Associative array of additive nature match Exact-match a custom variable match[type]=shoes min Minimum-value variables min[price]=30000 max Maximum-value match max[price]=50000 tags Tag-match tags[]=blue
return array API result

saveInclude() public method

Save an include
public saveInclude ( string $include_name, array $include_fields = [] ) : array
$include_name string
$include_fields array
return array API result

saveList() public method

Create a list, or update a list.
public saveList ( string $list, string $type = null, boolean $primary = null, array $query = [] ) : array
$list string
$type string
$primary boolean
$query array
return array

saveTemplate() public method

Save a template.
public saveTemplate ( string $template_name, array $template_fields = [] ) : array
$template_name string
$template_fields array
return array API result

saveTemplateFromRevision() public method

Save a template from revision
public saveTemplateFromRevision ( string $template_name, $revision_id ) : array
$template_name string
$revision_id
return array API result

saveUser() public method

Save existing user
public saveUser ( String $id, array $options = [] ) : array
$id String
$options array
return array

scheduleBlast() public method

Schedule a mass mail blast
public scheduleBlast ( string $name, string $list, string $schedule_time, string $from_name, string $from_email, string $subject, string $content_html, string $content_text, array $options = [] ) : array
$name string the name to give to this new blast
$list string the mailing list name to send to
$schedule_time string when the blast should send. Dates in the past will be scheduled for immediate delivery. Any English textual datetime format known to PHP's strtotime function is acceptable, such as 2009-03-18 23:57:22 UTC, now (immediate delivery), +3 hours (3 hours from now), or February 14, 9:30 EST. Be sure to specify a timezone if you use an exact time.
$from_name string the name appearing in the "From" of the email
$from_email string The email address to use as the "from" – choose from any of your verified emails
$subject string the subject line of the email
$content_html string the HTML-format version of the email
$content_text string the text-format version of the email
$options array associative array blast_id copy_blast copy_template replyto report_email is_link_tracking is_google_analytics is_public suppress_list test_vars email_hour_range abtest test_percent data_feed_url
return array API result

scheduleBlastFromBlast() public method

Schedule a mass mail blast from previous blast
public scheduleBlastFromBlast ( String | integer $blast_id, String $schedule_time, array $options = [] ) : array
$blast_id String | integer
$schedule_time String
$options array
return array API result

scheduleBlastFromTemplate() public method

Schedule a mass mail from a template
public scheduleBlastFromTemplate ( String $template, String $list, String $schedule_time, array $options = [] ) : array
$template String
$list String
$schedule_time String
$options array
return array API result

send() public method

If you pass the $schedule_time parameter, the send will be scheduled for a future time. Options: replyto: override Reply-To header test: send as test email (subject line will be marked, will not count towards stats)
public send ( string $template, string $email, array $vars = [], array $options = [], string $schedule_time = null ) : array
$template string
$email string
$vars array
$options array
$schedule_time string
return array API result

setEmail() public method

$lists should be an assoc array mapping list name => 1 for subscribed, 0 for unsubscribed
public setEmail ( string $email, array $vars = [], array $lists = [], array $templates = [], integer $verified, string $optout = null, string $send = null, array $send_vars = [] ) : array
$email string
$vars array
$lists array
$templates array
$verified integer 1 or 0
$optout string
$send string
$send_vars array
return array API result

setEmail2() public method

Update / add email address
public setEmail2 ( $email, array $options = [] ) : array
$options array
return array API result

setHorizonCookie() public method

Set Horizon cookie
public setHorizonCookie ( string $email, string $domain = null, integer $duration = null, boolean $secure = false ) : boolean
$email string horizon user email
$domain string
$duration integer
$secure boolean
return boolean

setHttpHeaders() public method

public setHttpHeaders ( array $headers )
$headers array

stats() public method

Make Stats API Request
public stats ( array $data ) : array
$data array
return array API result

stats_blast() public method

Retrieve information about a particular blast or aggregated information from all of blasts over a specified date range.
public stats_blast ( $blast_id = null, $start_date = null, $end_date = null, array $data = [] ) : array
$data array
return array API result

stats_list() public method

Retrieve information about your subscriber counts on a particular list, on a particular day.
public stats_list ( String $list = null, String $date = null ) : array
$list String
$date String
return array API result

stats_send() public method

Retrieve information about a particular send or aggregated information from all of templates over a specified date range.
public stats_send ( $template = null, $start_date = null, $end_date = null, array $data = [] ) : array
$data array
return array API result

updateBlast() public method

updates existing blast
public updateBlast ( $blast_id, string $name = null, string $list = null, string $schedule_time = null, string $from_name = null, string $from_email = null, string $subject = null, string $content_html = null, string $content_text = null, array $options = [] ) : array
$name string
$list string
$schedule_time string
$from_name string
$from_email string
$subject string
$content_html string
$content_text string
$options array associative array blast_id copy_blast copy_template replyto report_email is_link_tracking is_google_analytics is_public suppress_list test_vars email_hour_range abtest test_percent data_feed_url
return array API result

Property Details

$api_key protected_oe property

Sailthru API Key
protected string $api_key
return string

$api_uri protected_oe property

Sailthru API URL, can be different for different users according to their settings
protected string $api_uri
return string

$http_request_type protected_oe property

cURL or non-cURL request
protected string $http_request_type
return string

$secret protected_oe property

Sailthru Secret
protected string $secret
return string

$user_agent_string protected_oe property

User agent making request to Sailthru API server Even, if you modify user-agent, please try to include 'PHP5' somewhere in the user-agent
protected String $user_agent_string
return String