PHP Class Sailthru_Client

Afficher le fichier Open project: sailthru/sailthru-php5-client Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

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

Method Details

__construct() public méthode

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 méthode

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

apiGet() public méthode

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
Résultat array

apiPost() public méthode

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
Résultat array

cancelBlast() public méthode

Cancel a scheduled Blast
public cancelBlast ( $blast_id ) : array
Résultat array API result

cancelSend() public méthode

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

deleteAlert() public méthode

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

deleteBlast() public méthode

Delete Blast
public deleteBlast ( $blast_id ) : array
Résultat array API result

deleteList() public méthode

Deletes a list.
public deleteList ( string $list ) : array
$list string
Résultat array

deleteTemplate() public méthode

Delete a template.
public deleteTemplate ( string $template_name ) : array
$template_name string
Résultat array API result

getAlert() public méthode

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

getBlast() public méthode

Get Blast information
public getBlast ( $blast_id ) : array
Résultat array API result

getBlasts() public méthode

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

getConnectTimeout() public méthode

public getConnectTimeout ( )

getEmail() public méthode

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

getInclude() public méthode

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

getIncludes() public méthode

Fetch name of all existing includes
public getIncludes ( ) : array
Résultat array API result

getJobStatus() public méthode

Get status of a job
public getJobStatus ( String $job_id ) : array
$job_id String
Résultat array

getLastRateLimitInfo() public méthode

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
Résultat array or null

getLastResponseInfo() public méthode

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

getList() public méthode

Get information about a list.
public getList ( string $list ) : array
$list string
Résultat array

getLists() public méthode

Get information about all lists
public getLists ( ) : array
Résultat array

getSend() public méthode

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

getTemplate() public méthode

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

getTemplateFromRevision() public méthode

public getTemplateFromRevision ( $revision_id )

getTemplates() public méthode

Fetch name of all existing templates
public getTemplates ( ) : array
Résultat array API result

getTimeout() public méthode

public getTimeout ( )

getTriggerByEvent() public méthode

Get information on a trigger
public getTriggerByEvent ( string $event ) : array
$event string
Résultat array

getTriggerById() public méthode

Get information on a trigger
public getTriggerById ( string $trigger_id ) : array
$trigger_id string
Résultat array

getTriggerByTemplate() public méthode

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

getTriggers() public méthode

Get Triggers
public getTriggers ( ) : array
Résultat array

getUserByKey() public méthode

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

getUserBySid() public méthode

Get user by Sailthru ID
public getUserBySid ( String $id ) : array
$id String
Résultat array

httpRequest() protected méthode

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
Résultat string

httpRequestCurl() protected méthode

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
Résultat string

httpRequestWithoutCurl() protected méthode

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
Résultat string

multisend() public méthode

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
Résultat array API result

postEvent() public méthode

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

postEventTrigger() public méthode

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
Résultat array

postTrigger() public méthode

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
Résultat array

prepareJsonPayload() protected méthode

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

previewBlastWithEmail() public méthode

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

previewBlastWithHTML() public méthode

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

previewContentWithEmail() public méthode

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

previewContentWithHTML() public méthode

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

previewRecurringBlastWithEmail() public méthode

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

previewRecurringBlastWithHTML() public méthode

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

previewTemplateWithEmail() public méthode

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

previewTemplateWithHTML() public méthode

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

processBlastQueryJob() public méthode

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
Résultat array

processExportListJob() public méthode

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
Résultat array

processImportJob() public méthode

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
Résultat array

processImportJobFromFile() public méthode

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
Résultat array

processJob() protected méthode

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
Résultat array

processPurchaseImportJobFromFile() public méthode

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
Résultat array

processSnapshotJob() public méthode

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
Résultat array

processUpdateJob() public méthode

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
Résultat array

processUpdateJobFromEmails() public méthode

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
Résultat array

processUpdateJobFromFile() public méthode

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
Résultat array

processUpdateJobFromQuery() public méthode

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 méthode

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
Résultat array

purchase() public méthode

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
Résultat array API result

purchaseIncomplete() public méthode

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

pushContent() public méthode

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
Résultat array API result

receiveHardBouncePost() public méthode

Hard bounce postbacks
public receiveHardBouncePost ( ) : boolean
Résultat boolean

receiveOptoutPost() public méthode

Optout postbacks
public receiveOptoutPost ( ) : boolean
Résultat boolean

receiveUpdatePost() public méthode

Update postbacks
public receiveUpdatePost ( ) : boolean
Résultat boolean

receiveVerifyPost() public méthode

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

saveAlert() public méthode

$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
Résultat array API result

saveInclude() public méthode

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

saveList() public méthode

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
Résultat array

saveTemplate() public méthode

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

saveTemplateFromRevision() public méthode

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

saveUser() public méthode

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

scheduleBlast() public méthode

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
Résultat array API result

scheduleBlastFromBlast() public méthode

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
Résultat array API result

scheduleBlastFromTemplate() public méthode

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
Résultat array API result

send() public méthode

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
Résultat array API result

setEmail() public méthode

$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
Résultat array API result

setEmail2() public méthode

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

setHorizonCookie() public méthode

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
Résultat boolean

setHttpHeaders() public méthode

public setHttpHeaders ( array $headers )
$headers array

stats() public méthode

Make Stats API Request
public stats ( array $data ) : array
$data array
Résultat array API result

stats_blast() public méthode

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
Résultat array API result

stats_list() public méthode

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
Résultat array API result

stats_send() public méthode

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
Résultat array API result

updateBlast() public méthode

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
Résultat array API result

Property Details

$api_key protected_oe property

Sailthru API Key
protected string $api_key
Résultat string

$api_uri protected_oe property

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

$http_request_type protected_oe property

cURL or non-cURL request
protected string $http_request_type
Résultat string

$secret protected_oe property

Sailthru Secret
protected string $secret
Résultat 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
Résultat String