sailthru-client 1.04 → 1.05
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sailthru.rb +38 -3
- metadata +4 -4
data/lib/sailthru.rb
CHANGED
@@ -7,7 +7,7 @@ require 'digest/md5'
|
|
7
7
|
|
8
8
|
module Sailthru
|
9
9
|
|
10
|
-
Version = VERSION = '1.
|
10
|
+
Version = VERSION = '1.05'
|
11
11
|
|
12
12
|
class SailthruClientException < Exception
|
13
13
|
end
|
@@ -201,6 +201,41 @@ module Sailthru
|
|
201
201
|
api_post(:blast, post)
|
202
202
|
end
|
203
203
|
|
204
|
+
# Schedule a mass mail blast from template
|
205
|
+
def schedule_blast_from_template(template, list, schedule_time, options={})
|
206
|
+
post = options ? options : {}
|
207
|
+
post[:copy_template] = template
|
208
|
+
post[:list] = list
|
209
|
+
post[:schedule_time] = schedule_time
|
210
|
+
api_post(:blast, post)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Schedule a mass mail blast from previous blast
|
214
|
+
def schedule_blast_from_blast(blast_id, schedule_time, options={})
|
215
|
+
post = options ? options : {}
|
216
|
+
post[:copy_blast] = blast_id
|
217
|
+
#post[:name] = name
|
218
|
+
post[:schedule_time] = schedule_time
|
219
|
+
api_post(:blast, post)
|
220
|
+
end
|
221
|
+
|
222
|
+
def schedule_blast_from_copy(copy_blast = nil, copy_template = nil, options = {})
|
223
|
+
if copy_blast.nil? and copy_template.nil?
|
224
|
+
raise SailthruClientException.new('copy_blast and copy_template are both null')
|
225
|
+
end
|
226
|
+
|
227
|
+
post = options ? options : {}
|
228
|
+
if copy_blast != nil
|
229
|
+
post[:copy_blast] = copy_blast
|
230
|
+
end
|
231
|
+
|
232
|
+
if copy_template != nil
|
233
|
+
post[:copy_template] = copy_template
|
234
|
+
end
|
235
|
+
|
236
|
+
api_post(:blast, post)
|
237
|
+
end
|
238
|
+
|
204
239
|
|
205
240
|
# params
|
206
241
|
# blast_id, Fixnum | String
|
@@ -578,8 +613,6 @@ module Sailthru
|
|
578
613
|
api_delete(:alert, data)
|
579
614
|
end
|
580
615
|
|
581
|
-
protected
|
582
|
-
|
583
616
|
# Make Stats API Request
|
584
617
|
def stats(data)
|
585
618
|
api_get(:stats, data)
|
@@ -599,6 +632,8 @@ module Sailthru
|
|
599
632
|
def api_delete(action, data)
|
600
633
|
api_request(action, data, 'DELETE')
|
601
634
|
end
|
635
|
+
|
636
|
+
protected
|
602
637
|
|
603
638
|
# params:
|
604
639
|
# action, String
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sailthru-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: "1.
|
8
|
+
- 5
|
9
|
+
version: "1.05"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Prajwal Tuladhar
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-03-04 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|