Triggermail - Perl module for accessing SailThru's platform
use Triggermail; my $tm = Triggermail->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",'email@example.com',\%vars,\%options);
Triggermail is a Perl module for accesing the Sailthru platform.
All methods return a hash with return values. Dump the hash or explore the SailThru API documentation page for what might be returned. http://docs.sailthru.com/api
Some options might change. Always consult the SailThru API documentation for the best information.
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 an email to a single address. Takes template, email and schedule_time as strings. vars, options as hash references. Options: replyto: override Reply-To header test: send as test email (subject line will be marked, will not count towards stats)
Check if send worked, using send_id returned in the hash from send()
Schedule an email blast. See the API documentation for more details on what should be passed. L<http://docs.sailthru.com/api/blast>
Check if blast worked, using blast_id returned in the hash from scheduleBlast() Takes blast_id.
copyTemplate($template_name, $data_feed, $setup, $subject_line, $scedule_time, $list)
Allows you to use an existing template to send out a blast.
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. L<http://docs.sailthru.com/api>
Copyright (C) 2011 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.