lib/sailthru.rb in sailthru-client-1.07 vs lib/sailthru.rb in sailthru-client-1.08
- old
+ new
@@ -5,11 +5,11 @@
require 'json'
require 'digest/md5'
module Sailthru
- Version = VERSION = '1.07'
+ Version = VERSION = '1.08'
class SailthruClientException < Exception
end
module Helpers
@@ -123,14 +123,13 @@
# replyto: override Reply-To header
# test: send as test email (subject line will be marked, will not count towards stats)
# returns:
# Hash, response data from server
def send(template_name, email, vars={}, options = {}, schedule_time = nil)
- post = {}
+ post = options ? options : {}
post[:template] = template_name
post[:email] = email
- post[:options] = options
if vars.length > 0
post[:vars] = vars
end
@@ -140,13 +139,12 @@
return self.api_post(:send, post)
end
def multi_send(template_name, emails, vars={}, options = {}, schedule_time = nil)
- post = {}
+ post = options ? options : {}
post[:template] = template_name
post[:email] = emails
- post[:options] = options
if schedule_time != nil
post[:schedule_time] = schedule_time
end