PHP Класс Sailthru_Client

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
parseRateLimitHeaders ( string $headers ) : array | null parse rate limit headers from http response

Описание методов

__construct() публичный Метод

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() публичный Метод

Perform an API DELETE request, using the shared-secret auth hash.
public apiDelete ( string $action, array $data, $options = [] ) : array
$action string
$data array
Результат array

apiGet() публичный Метод

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
Результат array

apiPost() публичный Метод

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
Результат array

cancelBlast() публичный Метод

Cancel a scheduled Blast
public cancelBlast ( $blast_id ) : array
Результат array API result

cancelSend() публичный Метод

Cancel a send that was scheduled for a future time.
public cancelSend ( string $send_id ) : array
$send_id string
Результат array API result

deleteAlert() публичный Метод

Remove an alert from a user's settings.
public deleteAlert ( $email, $alert_id ) : array
$email
$alert_id
Результат array API result

deleteBlast() публичный Метод

Delete Blast
public deleteBlast ( $blast_id ) : array
Результат array API result

deleteList() публичный Метод

Deletes a list.
public deleteList ( string $list ) : array
$list string
Результат array

deleteTemplate() публичный Метод

Delete a template.
public deleteTemplate ( string $template_name ) : array
$template_name string
Результат array API result

getAlert() публичный Метод

Retrieve a user's alert settings.
public getAlert ( String $email ) : array
$email String
Результат array API result

getBlast() публичный Метод

Get Blast information
public getBlast ( $blast_id ) : array
Результат array API result

getBlasts() публичный Метод

Get info on multiple blasts
public getBlasts ( array $options ) : array
$options array associative array start_date (required) end-date (required) status
Результат array API result

getConnectTimeout() публичный Метод

public getConnectTimeout ( )

getEmail() публичный Метод

Return information about an email address, including replacement vars and lists.
public getEmail ( string $email, array $options = [] ) : array
$email string
$options array
Результат array API result

getInclude() публичный Метод

Fetch information about an include
public getInclude ( string $include_name, array $options = [] ) : array
$include_name string
$options array
Результат array API result

getIncludes() публичный Метод

Fetch name of all existing includes
public getIncludes ( ) : array
Результат array API result

getJobStatus() публичный Метод

Get status of a job
public getJobStatus ( String $job_id ) : array
$job_id String
Результат array

getLastRateLimitInfo() публичный Метод

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
Результат array or null

getLastResponseInfo() публичный Метод

get information from last server response when used with cURL returns associative array as per http://us.php.net/curl_getinfo
public getLastResponseInfo ( ) : array
Результат array or null

getList() публичный Метод

Get information about a list.
public getList ( string $list ) : array
$list string
Результат array

getLists() публичный Метод

Get information about all lists
public getLists ( ) : array
Результат array

getSend() публичный Метод

Get the status of a send.
public getSend ( string $send_id ) : array
$send_id string
Результат array API result

getTemplate() публичный Метод

Fetch information about a template
public getTemplate ( string $template_name, array $options = [] ) : array
$template_name string
$options array
Результат array API result

getTemplateFromRevision() публичный Метод

public getTemplateFromRevision ( $revision_id )

getTemplates() публичный Метод

Fetch name of all existing templates
public getTemplates ( ) : array
Результат array API result

getTimeout() публичный Метод

public getTimeout ( )

getTriggerByEvent() публичный Метод

Get information on a trigger
public getTriggerByEvent ( string $event ) : array
$event string
Результат array

getTriggerById() публичный Метод

Get information on a trigger
public getTriggerById ( string $trigger_id ) : array
$trigger_id string
Результат array

getTriggerByTemplate() публичный Метод

Get information on a trigger
public getTriggerByTemplate ( string $template, string $trigger_id = null ) : array
$template string
$trigger_id string
Результат array

getTriggers() публичный Метод

Get Triggers
public getTriggers ( ) : array
Результат array

getUserByKey() публичный Метод

Get user by specified key
public getUserByKey ( String $id, String $key, array $fields = [] ) : array
$id String
$key String
$fields array
Результат array

getUserBySid() публичный Метод

Get user by Sailthru ID
public getUserBySid ( String $id ) : array
$id String
Результат array

httpRequest() защищенный Метод

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
Результат string

httpRequestCurl() защищенный Метод

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
Результат string

httpRequestWithoutCurl() защищенный Метод

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
Результат string

multisend() публичный Метод

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
Результат array API result

postEvent() публичный Метод

Notify Sailthru of an event
public postEvent ( string $id, string $event, array $options = [] ) : array
$id string
$event string
$options array
Результат array

postEventTrigger() публичный Метод

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
Результат array

postTrigger() публичный Метод

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
Результат array

prepareJsonPayload() защищенный Метод

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

previewBlastWithEmail() публичный Метод

Get an email preview of a blast.
public previewBlastWithEmail ( $blast_id, $send_email ) : array
$blast_id
$send_email
Результат array

previewBlastWithHTML() публичный Метод

Get an HTML preview of a blast.
public previewBlastWithHTML ( $blast_id, $email ) : array
$blast_id
$email
Результат array

previewContentWithEmail() публичный Метод

Get an email preview of content_html.
public previewContentWithEmail ( $content_html, $send_email ) : array
$content_html
$send_email
Результат array

previewContentWithHTML() публичный Метод

Get an HTML preview of content_html.
public previewContentWithHTML ( $content_html, $email ) : array
$content_html
$email
Результат array

previewRecurringBlastWithEmail() публичный Метод

Get an email preview of a recurring blast.
public previewRecurringBlastWithEmail ( $blast_repeat_id, $send_email ) : array
$blast_repeat_id
$send_email
Результат array

previewRecurringBlastWithHTML() публичный Метод

Get an HTML preview of a recurring blast.
public previewRecurringBlastWithHTML ( $blast_repeat_id, $email ) : array
$blast_repeat_id
$email
Результат array

previewTemplateWithEmail() публичный Метод

Get an email preview of a template.
public previewTemplateWithEmail ( $template, $send_email ) : array
$template
$send_email
Результат array

previewTemplateWithHTML() публичный Метод

Get an HTML preview of a template.
public previewTemplateWithHTML ( $template, $email ) : array
$template
$email
Результат array

processBlastQueryJob() публичный Метод

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
Результат array

processExportListJob() публичный Метод

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
Результат array

processImportJob() публичный Метод

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
Результат array

processImportJobFromFile() публичный Метод

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
Результат array

processJob() защищенный Метод

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
Результат array

processPurchaseImportJobFromFile() публичный Метод

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
Результат array

processSnapshotJob() публичный Метод

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
Результат array

processUpdateJob() публичный Метод

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
Результат array

processUpdateJobFromEmails() публичный Метод

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
Результат array

processUpdateJobFromFile() публичный Метод

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
Результат array

processUpdateJobFromQuery() публичный Метод

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() публичный Метод

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
Результат array

purchase() публичный Метод

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
Результат array API result

purchaseIncomplete() публичный Метод

Make a purchase API call with incomplete flag
public purchaseIncomplete ( $email, array $items, $message_id, array $options = [] ) : array
$items array
$options array
Результат array API result

pushContent() публичный Метод

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
Результат array API result

receiveHardBouncePost() публичный Метод

Hard bounce postbacks
public receiveHardBouncePost ( ) : boolean
Результат boolean

receiveOptoutPost() публичный Метод

Optout postbacks
public receiveOptoutPost ( ) : boolean
Результат boolean

receiveUpdatePost() публичный Метод

Update postbacks
public receiveUpdatePost ( ) : boolean
Результат boolean

receiveVerifyPost() публичный Метод

Returns true if the incoming request is an authenticated verify post.
public receiveVerifyPost ( ) : boolean
Результат boolean

saveAlert() публичный Метод

$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
Результат array API result

saveInclude() публичный Метод

Save an include
public saveInclude ( string $include_name, array $include_fields = [] ) : array
$include_name string
$include_fields array
Результат array API result

saveList() публичный Метод

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
Результат array

saveTemplate() публичный Метод

Save a template.
public saveTemplate ( string $template_name, array $template_fields = [] ) : array
$template_name string
$template_fields array
Результат array API result

saveTemplateFromRevision() публичный Метод

Save a template from revision
public saveTemplateFromRevision ( string $template_name, $revision_id ) : array
$template_name string
$revision_id
Результат array API result

saveUser() публичный Метод

Save existing user
public saveUser ( String $id, array $options = [] ) : array
$id String
$options array
Результат array

scheduleBlast() публичный Метод

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
Результат array API result

scheduleBlastFromBlast() публичный Метод

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
Результат array API result

scheduleBlastFromTemplate() публичный Метод

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
Результат array API result

send() публичный Метод

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
Результат array API result

setEmail() публичный Метод

$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
Результат array API result

setEmail2() публичный Метод

Update / add email address
public setEmail2 ( $email, array $options = [] ) : array
$options array
Результат array API result

setHorizonCookie() публичный Метод

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
Результат boolean

setHttpHeaders() публичный Метод

public setHttpHeaders ( array $headers )
$headers array

stats() публичный Метод

Make Stats API Request
public stats ( array $data ) : array
$data array
Результат array API result

stats_blast() публичный Метод

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
Результат array API result

stats_list() публичный Метод

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
Результат array API result

stats_send() публичный Метод

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
Результат array API result

updateBlast() публичный Метод

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
Результат array API result

Описание свойств

$api_key защищенное свойство

Sailthru API Key
protected string $api_key
Результат string

$api_uri защищенное свойство

Sailthru API URL, can be different for different users according to their settings
protected string $api_uri
Результат string

$http_request_type защищенное свойство

cURL or non-cURL request
protected string $http_request_type
Результат string

$secret защищенное свойство

Sailthru Secret
protected string $secret
Результат string

$user_agent_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
protected String $user_agent_string
Результат String