gnumarcelo-campaigning 0.8.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -2
- data/VERSION.yml +2 -2
- data/lib/campaigning/campaigning.rb +9 -5
- data/lib/campaigning/helpers/helpers.rb +23 -15
- data/lib/campaigning/soap/soap_driver.rb +4 -0
- data/lib/campaigning/types/campaign.rb +12 -13
- data/lib/campaigning/types/client.rb +39 -39
- data/lib/campaigning/types/list.rb +28 -28
- data/lib/campaigning/types/subscriber.rb +6 -6
- data/test/campaigning_test.rb +139 -139
- metadata +2 -3
- data/TODO.txt +0 -48
data/README.rdoc
CHANGED
@@ -46,9 +46,9 @@ Sample use of the Client class:
|
|
46
46
|
#Here is how to create a brand new subscriber list for an Client
|
47
47
|
client = Campaigning::Client.find_by_name("Client One Company")
|
48
48
|
list = Campaigning::List.create(
|
49
|
-
:
|
49
|
+
:clientID => client.clientID,
|
50
50
|
:title => "List of people from Brazil",
|
51
|
-
:
|
51
|
+
:confirmOptIn => false
|
52
52
|
)
|
53
53
|
|
54
54
|
For further examples please check at the *sample* directory.
|
data/VERSION.yml
CHANGED
@@ -14,23 +14,27 @@ module Campaigning
|
|
14
14
|
#allowing you accurately determine the time on our server when you carry out the synchronization.
|
15
15
|
def self.system_date
|
16
16
|
response = Campaigning::SOAPDriver.instance.get_driver.getSystemDate(:apiKey => CAMPAIGN_MONITOR_API_KEY)
|
17
|
-
dateTime =
|
17
|
+
dateTime = handle_response response.user_GetSystemDateResult
|
18
18
|
end
|
19
19
|
|
20
20
|
#This method returns an Array of Strings representing all the available timezones.
|
21
|
-
def self.
|
22
|
-
|
21
|
+
def self.timezones
|
22
|
+
handle_response Campaigning::SOAPDriver.instance.get_driver.getTimezones(:apiKey => CAMPAIGN_MONITOR_API_KEY).user_GetTimezonesResult
|
23
23
|
end
|
24
24
|
|
25
25
|
#This method returns an Array of Strings representing all the available countries.
|
26
26
|
def self.countries
|
27
27
|
response = Campaigning::SOAPDriver.instance.get_driver.getCountries(:apiKey => CAMPAIGN_MONITOR_API_KEY)
|
28
|
-
dateTime =
|
28
|
+
dateTime = handle_response response.user_GetCountriesResult
|
29
29
|
end
|
30
30
|
|
31
31
|
#This method turns on and off the API debug mode, which will display at the console all SOAP requests made to the API server.
|
32
32
|
#
|
33
33
|
def self.setup_debug_mode(dev)
|
34
34
|
Campaigning::SOAPDriver.instance.setup_debug_mode dev
|
35
|
-
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.set_endpoint_url(endpoint_url)
|
38
|
+
Campaigning::SOAPDriver.instance.set_endpoint_url endpoint_url
|
39
|
+
end
|
36
40
|
end
|
@@ -1,19 +1,27 @@
|
|
1
1
|
module Campaigning
|
2
|
-
module Helpers #:nodoc:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
module Helpers #:nodoc:
|
3
|
+
def self.included(base)
|
4
|
+
base.extend(ClassMethods) # Make all ClassMethods methods avaiable to the object including this module.
|
5
|
+
private :handle_response
|
6
|
+
end
|
7
|
+
|
8
|
+
def handle_response(response)
|
9
|
+
self.class.handle_response(response)
|
10
|
+
end
|
11
|
+
|
12
|
+
# All methods above will became Object methods
|
13
|
+
module ClassMethods #:nodoc:
|
14
|
+
|
15
|
+
#Method responsable to handle all response from the API server and raising an exception when
|
16
|
+
#the API returns an error code (different from 0 (zero) ).
|
17
|
+
def handle_response(response)
|
18
|
+
if (response.class == Campaigning::Result && response.code != 0)
|
19
|
+
raise response.code.to_s + " - " + response.message
|
20
|
+
end
|
21
|
+
response
|
22
|
+
end
|
23
|
+
|
14
24
|
end
|
15
|
-
|
25
|
+
|
16
26
|
end
|
17
|
-
|
18
|
-
end
|
19
27
|
end
|
@@ -19,8 +19,12 @@ module Campaigning
|
|
19
19
|
#SOAP requests made to the API server.
|
20
20
|
def setup_debug_mode(dev)
|
21
21
|
dev = STDERR if dev == true
|
22
|
+
get_driver
|
22
23
|
@driver.wiredump_dev = dev
|
23
24
|
end
|
24
25
|
|
26
|
+
def set_endpoint_url(endpoint_url)
|
27
|
+
@driver = Campaigning::ApiSoap.new(endpoint_url)
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
@@ -58,7 +58,7 @@ module Campaigning
|
|
58
58
|
:listSegments => params[:listSegments]
|
59
59
|
)
|
60
60
|
|
61
|
-
campaign_id =
|
61
|
+
campaign_id = handle_response response.campaign_CreateResult
|
62
62
|
Campaign.new campaign_id
|
63
63
|
end
|
64
64
|
|
@@ -73,7 +73,7 @@ module Campaigning
|
|
73
73
|
#*Error*: An Exception containing the cause of the error will be raised.
|
74
74
|
def bounces
|
75
75
|
response = @soap.getCampaignBounces(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
76
|
-
|
76
|
+
handle_response response.campaign_GetBouncesResult
|
77
77
|
end
|
78
78
|
|
79
79
|
#Returns an array of Campaigning::List objects that a given campaign was sent to.
|
@@ -85,8 +85,7 @@ module Campaigning
|
|
85
85
|
#*Error*: An Exception containing the cause of the error will be raised.
|
86
86
|
def lists
|
87
87
|
response = @soap.getCampaignLists(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
88
|
-
lists =
|
89
|
-
puts "LISTAS!!!!!!!!!!" + lists.inspect
|
88
|
+
lists = handle_response response.campaign_GetListsResult
|
90
89
|
lists.collect do |list|
|
91
90
|
List.new(list.listID, list.name)
|
92
91
|
end
|
@@ -103,7 +102,7 @@ module Campaigning
|
|
103
102
|
#*Error*: An Exception containing the cause of the error will be raised.
|
104
103
|
def opens
|
105
104
|
response = @soap.getCampaignOpens(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
106
|
-
|
105
|
+
handle_response response.campaign_GetOpensResult
|
107
106
|
end
|
108
107
|
|
109
108
|
#Gets a list of all subscribers who clicked a link for a given campaign, the ID of the list they belong to,
|
@@ -128,7 +127,7 @@ module Campaigning
|
|
128
127
|
#*Error*: An Exception containing the cause of the error will be raised.
|
129
128
|
def subscriber_clicks
|
130
129
|
response = @soap.getSubscriberClicks(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
131
|
-
|
130
|
+
handle_response response.campaign_GetSubscriberClicksResult
|
132
131
|
end
|
133
132
|
|
134
133
|
#Gets a statistical summary, including number of recipients and open count, for a given campaign.
|
@@ -142,7 +141,7 @@ module Campaigning
|
|
142
141
|
#*Error*: An Exception containing the cause of the error will be raised.
|
143
142
|
def summary
|
144
143
|
response = @soap.getCampaignSummary(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
145
|
-
|
144
|
+
handle_response response.campaign_GetSummaryResult
|
146
145
|
end
|
147
146
|
|
148
147
|
#Gets a list of all subscribers who unsubscribed for a given campaign.
|
@@ -155,7 +154,7 @@ module Campaigning
|
|
155
154
|
#*Error*: An Exception containing the cause of the error will be raised.
|
156
155
|
def unsubscribes
|
157
156
|
response = @soap.getCampaignUnsubscribes(:apiKey => CAMPAIGN_MONITOR_API_KEY, :campaignID => @campaignID )
|
158
|
-
|
157
|
+
handle_response response.campaign_GetUnsubscribesResult
|
159
158
|
end
|
160
159
|
|
161
160
|
#Schedules an existing campaign for sending.
|
@@ -166,8 +165,8 @@ module Campaigning
|
|
166
165
|
#For further information about credits for campaigns please check at: http://www.campaignmonitor.com/api/method/campaign-send/
|
167
166
|
#
|
168
167
|
#Available _params_ argument are:
|
169
|
-
# * :
|
170
|
-
# * :
|
168
|
+
# * :confirmationEmail - The email address that the confirmation email that the campaign has been sent will go to.
|
169
|
+
# * :sendDate - The date the campaign should be scheduled to be sent. To send a campaign immediately pass in "Immediately".
|
171
170
|
# This date should be in the users timezone and formatted as YYYY-MM-DD HH:MM:SS.
|
172
171
|
#
|
173
172
|
#*Return*:
|
@@ -178,10 +177,10 @@ module Campaigning
|
|
178
177
|
response = @soap.sendCampaign(
|
179
178
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
180
179
|
:campaignID => @campaignID,
|
181
|
-
:confirmationEmail => params[:
|
182
|
-
:sendDate => params[:
|
180
|
+
:confirmationEmail => params[:confirmationEmail],
|
181
|
+
:sendDate => params[:sendDate]
|
183
182
|
)
|
184
|
-
|
183
|
+
handle_response response.campaign_SendResult
|
185
184
|
end
|
186
185
|
|
187
186
|
end
|
@@ -24,7 +24,7 @@ class Client
|
|
24
24
|
#*Error*: An Exception containing the cause of the error will be raised.
|
25
25
|
def lists
|
26
26
|
response = @soap.getClientLists(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => @clientID)
|
27
|
-
lists =
|
27
|
+
lists = handle_response response.client_GetListsResult
|
28
28
|
lists.collect {|list| List.new(list.listID, list.name)}
|
29
29
|
end
|
30
30
|
|
@@ -69,7 +69,7 @@ class Client
|
|
69
69
|
#*Error*: An Exception containing the cause of the error will be raised.
|
70
70
|
def self.get_all_clients
|
71
71
|
response = Campaigning::SOAPDriver.instance.get_driver.getClients(:apiKey => CAMPAIGN_MONITOR_API_KEY)
|
72
|
-
clients =
|
72
|
+
clients = handle_response response.user_GetClientsResult
|
73
73
|
clients.collect {|client| Client.new(client.clientID, client.name)}
|
74
74
|
end
|
75
75
|
|
@@ -78,13 +78,13 @@ class Client
|
|
78
78
|
#means of a subsequent call to Campaigning::Client#update_access_and_billing.
|
79
79
|
#
|
80
80
|
#Available _params_ argument are:
|
81
|
-
# * :
|
82
|
-
# * :
|
83
|
-
# * :
|
81
|
+
# * :companyName - The client company name.
|
82
|
+
# * :contactName - The personal name of the principle contact for this client.
|
83
|
+
# * :emailAddress - An email address to which this client will be sent application-related emails.
|
84
84
|
# * :country - This client's country. A valid country list is available in http://www.campaignmonitor.com/api/countries/ or by
|
85
85
|
# using the API procedure Campaigning.countries
|
86
|
-
# * :
|
87
|
-
# procedure Campaigning.
|
86
|
+
# * :timezone - Client timezone for tracking and reporting data. A valid timezone list is available here or by using the API
|
87
|
+
# procedure Campaigning.timezones.
|
88
88
|
#*Return*:
|
89
89
|
#
|
90
90
|
#*Success*: Upon a successful call, this method will return a Campaigning::Client object representing the newly created client.
|
@@ -93,13 +93,13 @@ class Client
|
|
93
93
|
def self.create(params)
|
94
94
|
response = Campaigning::SOAPDriver.instance.get_driver.createClient(
|
95
95
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
96
|
-
:companyName => params[:
|
97
|
-
:contactName => params[:
|
98
|
-
:emailAddress => params[:
|
96
|
+
:companyName => params[:companyName],
|
97
|
+
:contactName => params[:contactName],
|
98
|
+
:emailAddress => params[:emailAddress],
|
99
99
|
:country => params[:country],
|
100
|
-
:timezone => params[:
|
100
|
+
:timezone => params[:timezone]
|
101
101
|
)
|
102
|
-
Client.new(
|
102
|
+
Client.new( handle_response(response.client_CreateResult), params[:companyName] )
|
103
103
|
end
|
104
104
|
|
105
105
|
#Deletes a client from your account.
|
@@ -126,7 +126,7 @@ class Client
|
|
126
126
|
#*Error*: An Exception containing the cause of the error will be raised.
|
127
127
|
def self.delete(client_id)
|
128
128
|
response = Campaigning::SOAPDriver.instance.get_driver.deleteClient(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => client_id)
|
129
|
-
|
129
|
+
handle_response response.client_DeleteResult
|
130
130
|
end
|
131
131
|
|
132
132
|
#Gets a list of all subscriber segments for a client.
|
@@ -139,7 +139,7 @@ class Client
|
|
139
139
|
#*Error*: An Exception containing the cause of the error will be raised.
|
140
140
|
def segments # TODO: Verify the type return for this method.
|
141
141
|
response = @soap.getClientSegments(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => @clientID )
|
142
|
-
|
142
|
+
handle_response response.client_GetSegmentsResult
|
143
143
|
end
|
144
144
|
|
145
145
|
#This method finds campaigns by a given subject, since the subject isn't unique, it returns an collection of
|
@@ -170,7 +170,7 @@ class Client
|
|
170
170
|
#*Error*: An Exception containing the cause of the error will be raised.
|
171
171
|
def campaigns
|
172
172
|
response = @soap.getClientCampaigns(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => @clientID )
|
173
|
-
campaign_list =
|
173
|
+
campaign_list = handle_response response.client_GetCampaignsResult
|
174
174
|
campaign_list.collect do |campaign|
|
175
175
|
Campaign.new(campaign.campaignID, campaign.subject, campaign.sentDate, campaign.totalRecipients)
|
176
176
|
end
|
@@ -207,7 +207,7 @@ class Client
|
|
207
207
|
#*Error*: An Exception containing the cause of the error will be raised.
|
208
208
|
def details
|
209
209
|
response = @soap.getClientDetail(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => @clientID )
|
210
|
-
|
210
|
+
handle_response response.client_GetDetailResult
|
211
211
|
end
|
212
212
|
|
213
213
|
#Gets all subscribers in the client-wide suppression list.
|
@@ -219,7 +219,7 @@ class Client
|
|
219
219
|
#*Error*: An Exception containing the cause of the error will be raised.
|
220
220
|
def suppression_list
|
221
221
|
response = @soap.getClientSuppressionList(:apiKey => CAMPAIGN_MONITOR_API_KEY, :clientID => @clientID )
|
222
|
-
|
222
|
+
handle_response response.client_GetSuppressionListResult
|
223
223
|
end
|
224
224
|
|
225
225
|
#Update the access and billing settings of an existing client, leaving the basic details untouched.
|
@@ -229,23 +229,23 @@ class Client
|
|
229
229
|
#and will be fully described along with each parameter.
|
230
230
|
#
|
231
231
|
#Available _params_ argument are:
|
232
|
-
# * :
|
232
|
+
# * :accessLevel - An integer describing the client's ability to access different areas of the application. Influences the significance
|
233
233
|
# and requirements of the following parameters. See http://www.campaignmonitor.com/api/method/client-updateaccessandbilling/#accesslevels
|
234
234
|
# for a full description of available levels.
|
235
235
|
# * :username - Client login username. Not required and ignored if AccessLevel is set to 0.
|
236
236
|
# * :password - Client login password. Not required and ignored if AccessLevel is set to 0.
|
237
|
-
# * :
|
238
|
-
# * :currency - Billing currency for this client, only required if :
|
237
|
+
# * :billingType - Client billing type, only required if :accessLevel is set to allow the client to create and send campaigns
|
238
|
+
# * :currency - Billing currency for this client, only required if :billingType is set to either ClientPaysAtStandardRate or
|
239
239
|
# ClientPaysWithMarkup. See full details: http://www.campaignmonitor.com/api/method/client-updateaccessandbilling/#currencies.
|
240
|
-
# * :
|
240
|
+
# * :deliveryFee - Flat rate delivery fee to be charged to the client for each campaign sent, expressed in the chosen currency's
|
241
241
|
# major unit, but without the currency symbol (for example, sending "6.5" means "$6.50" if USD is used). Only
|
242
242
|
# required if BillingType is set to ClientPaysWithMarkup, in which case it should be at least equal to the standard rate.
|
243
243
|
# Further detail is available at http://help.campaignmonitor.com/topic.aspx?t=118.
|
244
|
-
# * :
|
244
|
+
# * :costPerRecipient - Additional cost added to the campaign for each email address the campaign is sent to, expressed in the chosen
|
245
245
|
# currency's minor unit (for example, sending "1.5" means 1.5 cents per email address if USD is used). Only required
|
246
246
|
# if BillingType is set to ClientPaysWithMarkup, in which case it should be at least equal to the standard cost/recipient
|
247
247
|
# rate. Further detail is available at http://help.campaignmonitor.com/topic.aspx?t=118.
|
248
|
-
# * :
|
248
|
+
# * :designAndSpamTestFee - Expressed in the chosen currency's major unit (for example, sending "10" means "$10" if USD is used). Only required
|
249
249
|
# if BillingType is set to ClientPaysWithMarkup and client has access to design and spam tests, in which case the fee
|
250
250
|
# should be equal to or higher than the standard rate (identical to the standard DeliveryFee for that currency).
|
251
251
|
#
|
@@ -263,16 +263,16 @@ class Client
|
|
263
263
|
response = @soap.updateClientAccessAndBilling(
|
264
264
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
265
265
|
:clientID => @clientID,
|
266
|
-
:accessLevel => params[:
|
266
|
+
:accessLevel => params[:accessLevel],
|
267
267
|
:username => params.fetch(:username, ""),
|
268
268
|
:password => params.fetch(:password, ""),
|
269
|
-
:billingType => params.fetch(:
|
269
|
+
:billingType => params.fetch(:billingType, ""),
|
270
270
|
:currency => params.fetch(:currency, ""),
|
271
|
-
:deliveryFee => params.fetch(:
|
272
|
-
:costPerRecipient => params.fetch(:
|
273
|
-
:designAndSpamTestFee => params.fetch(:
|
271
|
+
:deliveryFee => params.fetch(:deliveryFee, ""),
|
272
|
+
:costPerRecipient => params.fetch(:costPerRecipient, ""),
|
273
|
+
:designAndSpamTestFee => params.fetch(:designAndSpamTestFee, "")
|
274
274
|
)
|
275
|
-
|
275
|
+
handle_response response.client_UpdateAccessAndBillingResult
|
276
276
|
end
|
277
277
|
|
278
278
|
#Updates the basic details of an existing client.
|
@@ -280,12 +280,12 @@ class Client
|
|
280
280
|
#access and billing details will remain unchanged by a call to this method.
|
281
281
|
#
|
282
282
|
#Available _params_ argument are:
|
283
|
-
# * :
|
284
|
-
# * :
|
285
|
-
# * :
|
283
|
+
# * :companyName - The client company name.
|
284
|
+
# * :contactName - The personal name of the principle contact for this client.
|
285
|
+
# * :emailAddress - An email address to which this client will be sent application-related emails.
|
286
286
|
# * :country - This client's country.
|
287
|
-
# * :
|
288
|
-
# API procedure Campaigning.
|
287
|
+
# * :timezone - Client timezone for tracking and reporting data. Valid timezone strings are obtainable by means of the
|
288
|
+
# API procedure Campaigning.timezones.
|
289
289
|
#
|
290
290
|
#*Return*:
|
291
291
|
#
|
@@ -297,13 +297,13 @@ class Client
|
|
297
297
|
response = @soap.updateClientBasics(
|
298
298
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
299
299
|
:clientID => @clientID,
|
300
|
-
:companyName => params[:
|
301
|
-
:contactName => params[:
|
302
|
-
:emailAddress => params[:
|
300
|
+
:companyName => params[:companyName],
|
301
|
+
:contactName => params[:contactName],
|
302
|
+
:emailAddress => params[:emailAddress],
|
303
303
|
:country => params[:country],
|
304
|
-
:timezone => params[:
|
304
|
+
:timezone => params[:timezone]
|
305
305
|
)
|
306
|
-
|
306
|
+
handle_response response.client_UpdateBasicsResult
|
307
307
|
end
|
308
308
|
|
309
309
|
|
@@ -19,13 +19,13 @@ module Campaigning
|
|
19
19
|
#Creates a brand new subscriber list
|
20
20
|
#
|
21
21
|
#Available _params_ argument are:
|
22
|
-
# * :
|
22
|
+
# * :clientID - The ID of the client who will owner of the list.
|
23
23
|
# * :title - The list title. Must be unique for this client.
|
24
|
-
# * :
|
24
|
+
# * :unsubscribePage - The URL to which subscribers will be directed when unsubscribing from the list.
|
25
25
|
# If left blank or omitted a generic unsubscribe page is used.
|
26
|
-
# * :
|
26
|
+
# * :confirmOptIn - Either true or false depending on whether the list requires email confirmation or not. Please see
|
27
27
|
# the help documentation for more details of what this means.
|
28
|
-
# * :
|
28
|
+
# * :confirmationSuccessPage - Successful email confirmations will be redirected to this URL. Ignored if ConfirmOptIn
|
29
29
|
# is false. If left blank or omitted a generic confirmation page is used.
|
30
30
|
#*Return*:
|
31
31
|
#
|
@@ -35,21 +35,21 @@ module Campaigning
|
|
35
35
|
def self.create(params)
|
36
36
|
response = Campaigning::SOAPDriver.instance.get_driver.createList(
|
37
37
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
38
|
-
:clientID => params[:
|
38
|
+
:clientID => params[:clientID],
|
39
39
|
:title => params[:title],
|
40
|
-
:unsubscribePage => params.fetch(:
|
41
|
-
:confirmOptIn => params[:
|
42
|
-
:confirmationSuccessPage => params.fetch(:
|
40
|
+
:unsubscribePage => params.fetch(:unsubscribePage, ""),
|
41
|
+
:confirmOptIn => params[:confirmOptIn],
|
42
|
+
:confirmationSuccessPage => params.fetch(:confirmationSuccessPage, "")
|
43
43
|
)
|
44
|
-
new_list_id =
|
44
|
+
new_list_id = handle_response response.list_CreateResult
|
45
45
|
List.new(new_list_id, params[:title])
|
46
46
|
end
|
47
47
|
|
48
48
|
#Creates a new custom field for a list
|
49
49
|
#
|
50
50
|
#Available _params_ argument are:
|
51
|
-
# * :
|
52
|
-
# * :
|
51
|
+
# * :fieldName - The Name for the new Custom Field. This will be used to generate the custom fields Key.
|
52
|
+
# * :dataType - The Data Type for the new Custom Field. This must be one of Text, Number, MultiSelectOne, or MultiSelectMany
|
53
53
|
# * :options - The available options for a multi-valued custom field. Options should be an Array of Strings, like: %w[Brazil Ireland England].
|
54
54
|
# You can't pass this field for Text and Number custom fields
|
55
55
|
#
|
@@ -63,11 +63,11 @@ module Campaigning
|
|
63
63
|
response = @soap.createListCustomField(
|
64
64
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
65
65
|
:listID => @listID,
|
66
|
-
:fieldName => params[:
|
67
|
-
:dataType => params[:
|
66
|
+
:fieldName => params[:fieldName],
|
67
|
+
:dataType => params[:dataType],
|
68
68
|
:options => params.fetch(:options, "")
|
69
69
|
)
|
70
|
-
|
70
|
+
handle_response response.list_CreateCustomFieldResult
|
71
71
|
end
|
72
72
|
|
73
73
|
#Deletes a list
|
@@ -93,7 +93,7 @@ module Campaigning
|
|
93
93
|
#*Error*: An Exception containing the cause of the error will be raised.
|
94
94
|
def self.delete(list_id)
|
95
95
|
response = Campaigning::SOAPDriver.instance.get_driver.deleteList(:apiKey => CAMPAIGN_MONITOR_API_KEY, :listID => list_id)
|
96
|
-
|
96
|
+
handle_response response.list_DeleteResult
|
97
97
|
end
|
98
98
|
|
99
99
|
#Deletes a custom field from a list
|
@@ -106,7 +106,7 @@ module Campaigning
|
|
106
106
|
#*Error*: An Exception containing the cause of the error will be raised.
|
107
107
|
def delete_custom_field(key)
|
108
108
|
response = @soap.deleteListCustomField(:apiKey => CAMPAIGN_MONITOR_API_KEY, :listID => @listID, :key => '['+key+']')
|
109
|
-
|
109
|
+
handle_response response.list_DeleteCustomFieldResult
|
110
110
|
end
|
111
111
|
|
112
112
|
#Gets all the Custom Fields available for a list
|
@@ -119,7 +119,7 @@ module Campaigning
|
|
119
119
|
#*Error*: An Exception containing the cause of the error will be raised.
|
120
120
|
def custom_fields
|
121
121
|
response = @soap.getListCustomFields(:apiKey => CAMPAIGN_MONITOR_API_KEY, :listID => @listID)
|
122
|
-
|
122
|
+
handle_response response.list_GetCustomFieldsResult
|
123
123
|
end
|
124
124
|
|
125
125
|
#Gets a list's configuration detail
|
@@ -132,7 +132,7 @@ module Campaigning
|
|
132
132
|
#*Error*: An Exception containing the cause of the error will be raised.
|
133
133
|
def details
|
134
134
|
response = @soap.getListDetail(:apiKey => CAMPAIGN_MONITOR_API_KEY, :listID => @listID)
|
135
|
-
|
135
|
+
handle_response response.list_GetDetailResult
|
136
136
|
end
|
137
137
|
|
138
138
|
#Gets a list of all active subscribers for a list.
|
@@ -162,7 +162,7 @@ module Campaigning
|
|
162
162
|
:listID => @listID,
|
163
163
|
:date =>joined_at.strftime('%Y-%m-%d %H:%M:%S')
|
164
164
|
)
|
165
|
-
|
165
|
+
handle_response response.subscribers_GetActiveResult
|
166
166
|
end
|
167
167
|
|
168
168
|
#Gets a list of all subscribers for a list that have unsubscribed since the specified date.
|
@@ -182,7 +182,7 @@ module Campaigning
|
|
182
182
|
:listID => @listID,
|
183
183
|
:date => unjoined_at.strftime('%Y-%m-%d %H:%M:%S') # TODO: Move that to a helper method
|
184
184
|
)
|
185
|
-
|
185
|
+
handle_response response.subscribers_GetUnsubscribedResult
|
186
186
|
end
|
187
187
|
|
188
188
|
#This method returns all of a particular subscribers details, including email address, name, active/inactive
|
@@ -199,18 +199,18 @@ module Campaigning
|
|
199
199
|
:listID => @listID,
|
200
200
|
:emailAddress => email_address
|
201
201
|
)
|
202
|
-
|
202
|
+
handle_response response.subscribers_GetSingleSubscriberResult
|
203
203
|
end
|
204
204
|
|
205
205
|
#Update a subscriber list’s details
|
206
206
|
#
|
207
207
|
#Available _params_ argument are:
|
208
208
|
# * :title - The list title, as it will be shown in the application and through the API.
|
209
|
-
# * :
|
209
|
+
# * :unsubscribePage - The URL to which subscribers will be directed when unsubscribing from the list.
|
210
210
|
# If left blank or omitted a generic unsubscribe page is used.
|
211
|
-
# * :
|
211
|
+
# * :confirmOptIn - Either true or false depending on whether the list requires email confirmation or not. Please see
|
212
212
|
# the help documentation for more details of what this means.
|
213
|
-
# * :
|
213
|
+
# * :confirmationSuccessPage - Successful email confirmations will be redirected to this URL. Ignored if ConfirmOptIn
|
214
214
|
# is false. If left blank or omitted a generic confirmation page is used.
|
215
215
|
#
|
216
216
|
#*Return*:
|
@@ -224,11 +224,11 @@ module Campaigning
|
|
224
224
|
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
225
225
|
:listID => @listID,
|
226
226
|
:title => params[:title],
|
227
|
-
:unsubscribePage => params.fetch(:
|
228
|
-
:confirmOptIn => params[:
|
229
|
-
:confirmationSuccessPage => params.fetch(:
|
227
|
+
:unsubscribePage => params.fetch(:unsubscribePage, ""),
|
228
|
+
:confirmOptIn => params[:confirmOptIn],
|
229
|
+
:confirmationSuccessPage => params.fetch(:confirmationSuccessPage, "")
|
230
230
|
)
|
231
|
-
|
231
|
+
handle_response response.list_UpdateResult
|
232
232
|
end
|
233
233
|
|
234
234
|
protected
|
@@ -43,7 +43,7 @@ class Subscriber
|
|
43
43
|
:email => @emailAddress,
|
44
44
|
:name => @name
|
45
45
|
)
|
46
|
-
|
46
|
+
handle_response response.subscriber_AddResult
|
47
47
|
end
|
48
48
|
|
49
49
|
#Adds a subscriber (email address, name) to an existing subscriber list. If the subscriber (email address) already exists,
|
@@ -68,7 +68,7 @@ class Subscriber
|
|
68
68
|
:email => @emailAddress,
|
69
69
|
:name => @name
|
70
70
|
)
|
71
|
-
|
71
|
+
handle_response response.subscriber_AddAndResubscribeResult
|
72
72
|
end
|
73
73
|
|
74
74
|
|
@@ -95,7 +95,7 @@ class Subscriber
|
|
95
95
|
:name => @name,
|
96
96
|
:customFields => custom_fields_array(custom_fields)
|
97
97
|
)
|
98
|
-
|
98
|
+
handle_response response.subscriber_AddAndResubscribeWithCustomFieldsResult
|
99
99
|
end
|
100
100
|
|
101
101
|
#Adds a subscriber to a subscriber list, including adding custom field data for the subscriber. If the subscriber (email address)
|
@@ -121,7 +121,7 @@ class Subscriber
|
|
121
121
|
:name => @name,
|
122
122
|
:customFields => custom_fields_array(custom_fields)
|
123
123
|
)
|
124
|
-
|
124
|
+
handle_response response.subscriber_AddWithCustomFieldsResult
|
125
125
|
end
|
126
126
|
|
127
127
|
#Changes the status of an Active Subscriber to an Unsubscribed Subscriber who will no longer receive
|
@@ -148,7 +148,7 @@ class Subscriber
|
|
148
148
|
:listID => list_id,
|
149
149
|
:email => email
|
150
150
|
)
|
151
|
-
|
151
|
+
handle_response response.subscriber_UnsubscribeResult
|
152
152
|
end
|
153
153
|
|
154
154
|
#Returns True or False as to the existence of the given email address in the list supplied.
|
@@ -163,7 +163,7 @@ class Subscriber
|
|
163
163
|
:listID => list_id,
|
164
164
|
:email => email
|
165
165
|
)
|
166
|
-
response =
|
166
|
+
response = handle_response response.subscribers_GetIsSubscribedResult
|
167
167
|
response == 'True' ? true : false
|
168
168
|
end
|
169
169
|
|
data/test/campaigning_test.rb
CHANGED
@@ -1,51 +1,54 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
# Replace this API key with your own (http://www.campaignmonitor.com/api/)
|
4
|
-
CAMPAIGN_MONITOR_API_KEY = '
|
5
|
-
#CLIENT_ID = 'd7acfd4cd2ffffc2d86b8903d18a1276'
|
6
|
-
#CLIENT_TWO_ID = '730acd1e8d27d56bdb87e88685613d72'
|
4
|
+
CAMPAIGN_MONITOR_API_KEY = '__PUT_YOUR_API_KEY_HERE__'
|
7
5
|
|
8
6
|
class CampaigningTest < Test::Unit::TestCase
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
7
|
+
|
8
|
+
|
9
|
+
def setup
|
10
|
+
#Campaigning.set_endpoint_url "http://127.0.0.1:8088/mockapiSoap"
|
11
|
+
#Campaigning.setup_debug_mode(true)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_campaigning_system_date
|
15
|
+
date = Campaigning.system_date
|
16
|
+
assert !date.nil?
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_user_get_timezones
|
20
|
+
timezones = Campaigning.timezones
|
21
|
+
assert !timezones.nil?
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_user_countries
|
25
|
+
countries = Campaigning.countries
|
26
|
+
assert !countries.nil?
|
27
|
+
end
|
28
|
+
|
26
29
|
def test_client_get_all_clients
|
27
30
|
clients = Campaigning::Client.get_all_clients
|
28
31
|
assert clients.length > 0
|
29
32
|
#clients.each{ |c| puts c.clientID + " - " + c.name }
|
30
33
|
end
|
31
|
-
|
34
|
+
|
32
35
|
def test_client_lists
|
33
36
|
client = Campaigning::Client.find_by_name("Client One Company")
|
34
37
|
assert client.lists.length > 0
|
35
38
|
end
|
36
|
-
|
37
|
-
|
38
|
-
def test_client_create
|
39
|
-
client_created = Campaigning::Client.create(
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:country => "Ireland",
|
44
|
-
:
|
45
|
-
)
|
46
|
-
assert !client_created.clientID.nil?
|
47
|
-
end
|
48
|
-
|
39
|
+
|
40
|
+
#
|
41
|
+
# def test_client_create
|
42
|
+
# client_created = Campaigning::Client.create(
|
43
|
+
# :companyName => "My test client",
|
44
|
+
# :contactName => "Oswald Green15",
|
45
|
+
# :emailAddress => "og15@user.com",
|
46
|
+
# :country => "Ireland",
|
47
|
+
# :timezone => Campaigning.timezones[1]
|
48
|
+
# )
|
49
|
+
# assert !client_created.clientID.nil?
|
50
|
+
# end
|
51
|
+
#
|
49
52
|
# def test_client_delete
|
50
53
|
# response = Campaigning::Client.delete(client_created.clientID)
|
51
54
|
# assert response.code == 0
|
@@ -55,26 +58,24 @@ class CampaigningTest < Test::Unit::TestCase
|
|
55
58
|
# client = Campaigning::Client.find_by_name("Orange Company 7")
|
56
59
|
# client.delete
|
57
60
|
# end
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
|
62
|
+
def test_client_segments
|
63
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
64
|
+
assert client.segments.length > 0
|
65
|
+
end
|
66
|
+
|
67
|
+
|
66
68
|
def test_find_client_by_name
|
67
69
|
client = Campaigning::Client.find_by_name("Client One Company")
|
68
|
-
puts client.inspect
|
69
70
|
assert !client.nil? && client.name == "Client One Company"
|
70
71
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
|
73
|
+
|
74
|
+
def test_get_client_campaigns
|
75
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
76
|
+
puts client.campaigns.inspect
|
77
|
+
end
|
78
|
+
|
78
79
|
def test_get_client_details
|
79
80
|
client = Campaigning::Client.find_by_name("Client One Company")
|
80
81
|
# client_details = client.details
|
@@ -96,64 +97,63 @@ class CampaigningTest < Test::Unit::TestCase
|
|
96
97
|
# Cost per Recipient: #{access_and_billing_details.costPerRecipient} - \n
|
97
98
|
# Design and Span test Fee: #{access_and_billing_details.designAndSpamTestFee} - \n
|
98
99
|
# Access Level: #{access_and_billing_details.accessLevel}"
|
99
|
-
|
100
|
+
|
100
101
|
assert !client.details.nil?
|
101
|
-
|
102
|
+
|
102
103
|
end
|
103
|
-
|
104
|
-
# def test_get_client_suppression_list
|
105
|
-
# client = Campaigning::Client.find_by_name("Client One Company")
|
106
|
-
# puts client.suppression_list.inspect
|
107
|
-
# end
|
108
|
-
|
109
|
-
# def test_client_update_access_and_billing
|
110
|
-
# client = Campaigning::Client.find_by_name("Client One Company")
|
111
|
-
# response = client.update_access_and_billing(
|
112
|
-
# :access_level => 5 ,
|
113
|
-
# :username => "client_one",
|
114
|
-
# :password => "1234560",
|
115
|
-
# :billing_type => "UserPaysOnClientsBehalf",
|
116
|
-
# :currency => "USD",
|
117
|
-
# :delivery_fee => 6.5,
|
118
|
-
# :cost_per_recipient => 1.5 ,
|
119
|
-
# :design_and_spam_test_fee => 5
|
120
|
-
# )
|
121
|
-
# assert response.code == 0
|
122
|
-
# end
|
123
|
-
#
|
124
|
-
# def test_client_update_basics
|
125
|
-
# client = Campaigning::Client.find_by_name("Client Two ")
|
126
|
-
# response = client.update_basics(
|
127
|
-
# :company_name => "My new Company",
|
128
|
-
# :contact_name => "Mr. Gordon Newman",
|
129
|
-
# :email_address => "gordon-newman@test.com",
|
130
|
-
# :country => "Ireland",
|
131
|
-
# :time_zone => @cm.time_zones[1]
|
132
|
-
# )
|
133
|
-
# assert response.code == 0
|
134
|
-
# end
|
135
|
-
#
|
136
|
-
# def test_client_find_list_by_name
|
137
|
-
# client = Campaigning::Client.find_by_name("Client One Company")
|
138
|
-
# list = client.find_list_by_name "My Friends"
|
139
|
-
# puts list.inspect
|
140
|
-
# assert list.nil? == false
|
141
|
-
# end
|
142
104
|
|
143
|
-
|
105
|
+
def test_get_client_suppression_list
|
106
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
107
|
+
puts client.suppression_list.inspect
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_client_update_access_and_billing
|
111
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
112
|
+
response = client.update_access_and_billing(
|
113
|
+
:accessLevel => 5 ,
|
114
|
+
:username => "client_one",
|
115
|
+
:password => "1234560",
|
116
|
+
:billingType => "UserPaysOnClientsBehalf",
|
117
|
+
:currency => "USD",
|
118
|
+
:deliveryFee => 6.5,
|
119
|
+
:costPerRecipient => 1.5 ,
|
120
|
+
:designAndSpamTestFee => 5
|
121
|
+
)
|
122
|
+
assert response.code == 0
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_client_update_basics
|
126
|
+
client = Campaigning::Client.find_by_name("Client Two")
|
127
|
+
response = client.update_basics(
|
128
|
+
:companyName => "My new Company",
|
129
|
+
:contactName => "Mr. Gordon Newman",
|
130
|
+
:emailAddress => "gordon-newman@test.com",
|
131
|
+
:country => "Ireland",
|
132
|
+
:timezone => Campaigning.timezones[1]
|
133
|
+
)
|
134
|
+
assert response.code == 0
|
135
|
+
end
|
136
|
+
|
137
|
+
def test_client_find_list_by_name
|
138
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
139
|
+
list = client.find_list_by_name "My Friends"
|
140
|
+
assert list.nil? == false
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
144
|
# def test_campaign_create
|
145
145
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
146
146
|
# response = Campaigning::Campaign.create(
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
147
|
+
# :clientID => client.clientID,
|
148
|
+
# :campaignName => "Campaign by myself RUBY TO DELETE - CODEEEEE",
|
149
|
+
# :campaignSubject => "Campaign by myself - OK - CODEEEEE",
|
150
|
+
# :fromName => "Mr. Gordon2",
|
151
|
+
# :fromEmail => "gordon2@test.com",
|
152
|
+
# :replyTo => "no-reply@test.com",
|
153
|
+
# :htmlUrl => "http://www.campaignmonitor.com/api/method/campaign-create/",
|
154
|
+
# :textUrl => "http://www.google.com.br",
|
155
|
+
# :subscriberListIDs => ["ac52b645c048888a44c87b5f1ecf6b7d"],
|
156
|
+
# :listSegments => client.segments
|
157
157
|
# )
|
158
158
|
# puts response.inspect
|
159
159
|
# end
|
@@ -163,7 +163,7 @@ class CampaigningTest < Test::Unit::TestCase
|
|
163
163
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
164
164
|
# puts client.campaigns[1].bounces.inspect
|
165
165
|
# end
|
166
|
-
#
|
166
|
+
#
|
167
167
|
# def test_campaign_lists
|
168
168
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
169
169
|
# client.campaigns[0].lists
|
@@ -189,10 +189,10 @@ class CampaigningTest < Test::Unit::TestCase
|
|
189
189
|
# # end
|
190
190
|
# assert client.campaigns[2].subscriber_clicks != nil
|
191
191
|
# assert client.campaigns[2].subscriber_clicks != []
|
192
|
-
#
|
192
|
+
#
|
193
193
|
# end
|
194
194
|
#
|
195
|
-
#
|
195
|
+
#
|
196
196
|
# def test_campaign_summary
|
197
197
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
198
198
|
# puts client.campaigns[1].summary
|
@@ -206,24 +206,24 @@ class CampaigningTest < Test::Unit::TestCase
|
|
206
206
|
# def test_campaign_send
|
207
207
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
208
208
|
# response = Campaigning::Campaign.create(
|
209
|
-
#
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
209
|
+
# :clientID => client.clientID,
|
210
|
+
# :campaignName => "Campaign by myself RUBY NEW CREATED",
|
211
|
+
# :campaignSubject => "Campaign by myself - OK",
|
212
|
+
# :fromName => "Mr. Gordon2",
|
213
|
+
# :fromEmail => "gordon2@test.com",
|
214
|
+
# :replyTo => "no-reply@test.com",
|
215
|
+
# :htmlUrl => "http://www.campaignmonitor.com/api/method/campaign-create/",
|
216
|
+
# :textUrl => "http://www.google.com",
|
217
|
+
# :subscriberListIDs => ["ac52b645c048888a44c87b5f1ecf6b7d"],
|
218
|
+
# :listSegments => client.segments
|
219
219
|
# )
|
220
|
-
#
|
220
|
+
#
|
221
221
|
# puts client.campaigns[0].send(
|
222
|
-
#
|
223
|
-
#
|
222
|
+
# :confirmationEmail => "userhdhd@test.com",
|
223
|
+
# :sendDate => "2009-04-30 11:55:01" # Date format YYYY-MM-DD HH:MM:SS.
|
224
224
|
# )
|
225
225
|
# end
|
226
|
-
|
226
|
+
#
|
227
227
|
# def test_subscriber_add
|
228
228
|
# subscriber = Campaigning::Subscriber.new("robertf@test.com", "Robert Franklin")
|
229
229
|
# response = subscriber.add("ac52b645c048888a44c87b5f1ecf6b7d")
|
@@ -235,8 +235,8 @@ class CampaigningTest < Test::Unit::TestCase
|
|
235
235
|
# response = subscriber.add_and_resubscribe("ac52b645c048888a44c87b5f1ecf6b7d")
|
236
236
|
# assert response.code == 0
|
237
237
|
# end
|
238
|
-
|
239
|
-
|
238
|
+
#
|
239
|
+
#
|
240
240
|
# def test_subscriber_add_and_resubscribe_with_custom_fields
|
241
241
|
# subscriber = Campaigning::Subscriber.new("user_custon@test.com", "Mr. Custon")
|
242
242
|
# response = subscriber.add_and_resubscribe_with_custom_fields("ac52b645c048888a44c87b5f1ecf6b7d", :CityName => "Dublin", :SponsorName => "Some Sponsor")
|
@@ -287,7 +287,7 @@ class CampaigningTest < Test::Unit::TestCase
|
|
287
287
|
# subscriber_list = list.find_active_subscribers(DateTime.new(y=2009,m=5,d=01, h=01,min=00,s=00))
|
288
288
|
# assert subscriber_list.length > 0
|
289
289
|
# end
|
290
|
-
|
290
|
+
#
|
291
291
|
# def test_list_get_all_active_subscribers
|
292
292
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
293
293
|
# list = client.find_list_by_name "My Friends"
|
@@ -295,17 +295,17 @@ class CampaigningTest < Test::Unit::TestCase
|
|
295
295
|
# puts subscriber_list.inspect
|
296
296
|
# assert subscriber_list.length > 0
|
297
297
|
# end
|
298
|
-
|
299
|
-
|
300
|
-
|
298
|
+
#
|
299
|
+
#
|
300
|
+
#
|
301
301
|
# def test_list_create
|
302
302
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
303
303
|
# list = Campaigning::List.create(
|
304
|
-
#
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
304
|
+
# :clientID => client.clientID,
|
305
|
+
# :title => "New list to test",
|
306
|
+
# :unsubscribePage => "",
|
307
|
+
# :confirmOptIn => false,
|
308
|
+
# :confirmationSuccessPage => ""
|
309
309
|
# )
|
310
310
|
# assert list.listID != nil
|
311
311
|
# end
|
@@ -314,9 +314,9 @@ class CampaigningTest < Test::Unit::TestCase
|
|
314
314
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
315
315
|
# list = client.find_list_by_name "My Friends"
|
316
316
|
# result = list.create_custom_field(
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
317
|
+
# :fieldName => "Country" ,
|
318
|
+
# :dataType => "MultiSelectOne",
|
319
|
+
# :options => %w[Brazil Ireland England]
|
320
320
|
# )
|
321
321
|
# assert result.code == 0
|
322
322
|
# end
|
@@ -351,13 +351,13 @@ class CampaigningTest < Test::Unit::TestCase
|
|
351
351
|
# client = Campaigning::Client.find_by_name("Client One Company")
|
352
352
|
# list = client.find_list_by_name "My Friends"
|
353
353
|
# result = list.update(
|
354
|
-
#
|
355
|
-
#
|
356
|
-
#
|
357
|
-
#
|
354
|
+
# :title => "NEW TITLE : My new list created by ruby list.create",
|
355
|
+
# :unsubscribePage => "",
|
356
|
+
# :confirmOptIn => false,
|
357
|
+
# :confirmationSuccessPage => ""
|
358
358
|
# )
|
359
359
|
# assert result.code == 0
|
360
360
|
# end
|
361
|
-
|
362
|
-
|
361
|
+
|
362
|
+
|
363
363
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gnumarcelo-campaigning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Menezes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -35,7 +35,6 @@ files:
|
|
35
35
|
- LICENSE
|
36
36
|
- README.rdoc
|
37
37
|
- Rakefile
|
38
|
-
- TODO.txt
|
39
38
|
- VERSION.yml
|
40
39
|
- lib/campaigning.rb
|
41
40
|
- lib/campaigning/campaigning.rb
|
data/TODO.txt
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
*
|
2
|
-
Campaigns
|
3
|
-
o Campaign.Create - OK (Not tested)
|
4
|
-
o Campaign.GetBounces - OK
|
5
|
-
o Campaign.GetLists - OK
|
6
|
-
o Campaign.GetOpens - OK
|
7
|
-
o Campaign.GetSubscriberClicks - OK
|
8
|
-
o Campaign.GetSummary - OK
|
9
|
-
o Campaign.GetUnsubscribes - OK
|
10
|
-
o Campaign.Send - OK (Not Tested)
|
11
|
-
*
|
12
|
-
Clients
|
13
|
-
o Client.Create - OK
|
14
|
-
o Client.Delete - OK
|
15
|
-
o Client.GetCampaigns - OK
|
16
|
-
o Client.GetDetail - OK
|
17
|
-
o Client.GetLists - OK
|
18
|
-
o Client.GetSegments - OK
|
19
|
-
o Client.GetSuppressionList - OK (Not tested)
|
20
|
-
o Client.UpdateAccessAndBilling - OK
|
21
|
-
o Client.UpdateBasics - OK
|
22
|
-
*
|
23
|
-
Subscribers
|
24
|
-
o Subscriber.Add - OK
|
25
|
-
o Subscriber.AddAndResubscribe - OK
|
26
|
-
o Subscriber.AddAndResubscribeWithCustomFields - OK
|
27
|
-
o Subscriber.AddWithCustomFields - OK
|
28
|
-
o Subscriber.Unsubscribe - OK
|
29
|
-
o Subscribers.GetActive - OK - Here?
|
30
|
-
o Subscribers.GetBounced - OK
|
31
|
-
o Subscribers.GetIsSubscribed - OK
|
32
|
-
o Subscribers.GetSingleSubscriber - OK
|
33
|
-
o Subscribers.GetUnsubscribed - OK - Here?
|
34
|
-
*
|
35
|
-
Lists
|
36
|
-
o List.Create - OK
|
37
|
-
o List.CreateCustomField - OK
|
38
|
-
o List.Delete - OK
|
39
|
-
o List.DeleteCustomField - OK
|
40
|
-
o List.GetCustomFields - OK
|
41
|
-
o List.GetDetail - OK
|
42
|
-
o List.Update - OK
|
43
|
-
*
|
44
|
-
Users
|
45
|
-
o User.GetClients - OK
|
46
|
-
o User.GetCountries - OK
|
47
|
-
o User.GetSystemDate - OK
|
48
|
-
o User.GetTimezones - OK
|