Sailthru::Client - Perl module for accessing SailThru's API
use Sailthru::Client; my $tm = Sailthru::Client->new('api_key','secret'); # You can optionally include a timeout in seconds as a third parameter. %vars = ( name => "Joe Example", from_email => "approved_email@your_domain.com", your_variable => "some_value"); %options = ( reply_to => "your reply_to header"); $tm->send("template_name",'firstname.lastname@example.org',\%vars,\%options);
Sailthru::Client is a Perl module for accesing the Sailthru API.
All methods return a hash with return values. Dump the hash or explore the SailThru API documentation page for what might be returned.
Some options might change. Always consult the SailThru API documentation for the best information.
getEmail( $email, )
setEmail( $email, \%vars, \%lists, \%templates )
Takes email as string. vars, lists, templates as hash references. The vars hash you choose your own key/values for later substitution. The lists hash should be of format list_name => 1 for subscribed, 0 for unsubscribed. The templates hash is a list of templates user has opted out, use the key as the template name to signal opt-out. As always, see the Sailthru documentation for more information.
send( $template, $email, \%vars, \%options, $schedule_time )
Send an email to a single address. Takes template, email and schedule_time as strings. vars, options as hash references.
getSend( $send_id )
Check if send worked, using send_id returned in the hash from send()
scheduleBlast( $name, $list, $schedule_time, $from_name, $from_email, $subject, $content_html, $content_text, \%options )
Schedule an email blast. See the API documentation for more details on what should be passed.
getBlast( $blast_id )
Check if blast worked, using blast_id returned in the hash from scheduleBlast() Takes blast_id.
copyTemplate( $template_name, $data_feed, $setup, $subject_line, $schedule_time, $list )
Allows you to use an existing template to send out a blast.
getTemplate( $template_name )
Retrieves information about the template
importContacts( $email, $password )
Import contacts from major providers. Takes email, password as strings. By default does not include names. Pass 1 as third argument to include names.
See the SailThru API documentation for more details on their API.
Copyright (C) 2011 by Steve Miketa <email@example.com>
Adapted from the original Triggermail module created by Sam Gerstenzang
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.