gnumarcelo-campaigning 0.12.1 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/lib/campaigning/campaign.rb +24 -19
- data/lib/campaigning/campaigning.rb +16 -6
- data/lib/campaigning/client.rb +51 -25
- data/lib/campaigning/list.rb +19 -14
- data/lib/campaigning/soap/generated/default.rb +162 -0
- data/lib/campaigning/soap/generated/defaultDriver.rb +40 -0
- data/lib/campaigning/soap/generated/defaultMappingRegistry.rb +131 -0
- data/lib/campaigning/subscriber.rb +17 -10
- data/lib/campaigning/template.rb +124 -0
- data/test/campaigning_test.rb +0 -6
- data/test/client_test.rb +28 -15
- data/test/template_test.rb +62 -0
- metadata +5 -2
@@ -215,6 +215,25 @@ class ClientAccessAndBilling
|
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
218
|
+
# {http://api.createsend.com/api/}Template
|
219
|
+
# templateID - SOAP::SOAPString
|
220
|
+
# name - SOAP::SOAPString
|
221
|
+
# previewURL - SOAP::SOAPString
|
222
|
+
# screenshotURL - SOAP::SOAPString
|
223
|
+
class Template
|
224
|
+
attr_accessor :templateID
|
225
|
+
attr_accessor :name
|
226
|
+
attr_accessor :previewURL
|
227
|
+
attr_accessor :screenshotURL
|
228
|
+
|
229
|
+
def initialize(templateID = nil, name = nil, previewURL = nil, screenshotURL = nil)
|
230
|
+
@templateID = templateID
|
231
|
+
@name = name
|
232
|
+
@previewURL = previewURL
|
233
|
+
@screenshotURL = screenshotURL
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
218
237
|
# {http://api.createsend.com/api/}List
|
219
238
|
# listID - SOAP::SOAPString
|
220
239
|
# name - SOAP::SOAPString
|
@@ -330,6 +349,10 @@ end
|
|
330
349
|
class ArrayOfList < ::Array
|
331
350
|
end
|
332
351
|
|
352
|
+
# {http://api.createsend.com/api/}ArrayOfTemplate
|
353
|
+
class ArrayOfTemplate < ::Array
|
354
|
+
end
|
355
|
+
|
333
356
|
# {http://api.createsend.com/api/}ArrayOfSubscriberClick
|
334
357
|
class ArrayOfSubscriberClick < ::Array
|
335
358
|
end
|
@@ -925,6 +948,29 @@ class ClientGetSuppressionListResponse
|
|
925
948
|
end
|
926
949
|
end
|
927
950
|
|
951
|
+
# {http://api.createsend.com/api/}Client.GetTemplates
|
952
|
+
# apiKey - SOAP::SOAPString
|
953
|
+
# clientID - SOAP::SOAPString
|
954
|
+
class ClientGetTemplates
|
955
|
+
attr_accessor :apiKey
|
956
|
+
attr_accessor :clientID
|
957
|
+
|
958
|
+
def initialize(apiKey = nil, clientID = nil)
|
959
|
+
@apiKey = apiKey
|
960
|
+
@clientID = clientID
|
961
|
+
end
|
962
|
+
end
|
963
|
+
|
964
|
+
# {http://api.createsend.com/api/}Client.GetTemplatesResponse
|
965
|
+
# client_GetTemplatesResult - (any)
|
966
|
+
class ClientGetTemplatesResponse
|
967
|
+
attr_accessor :client_GetTemplatesResult
|
968
|
+
|
969
|
+
def initialize(client_GetTemplatesResult = nil)
|
970
|
+
@client_GetTemplatesResult = client_GetTemplatesResult
|
971
|
+
end
|
972
|
+
end
|
973
|
+
|
928
974
|
# {http://api.createsend.com/api/}Client.Create
|
929
975
|
# apiKey - SOAP::SOAPString
|
930
976
|
# companyName - SOAP::SOAPString
|
@@ -1411,6 +1457,122 @@ class CampaignDeleteResponse
|
|
1411
1457
|
end
|
1412
1458
|
end
|
1413
1459
|
|
1460
|
+
# {http://api.createsend.com/api/}Template.Create
|
1461
|
+
# apiKey - SOAP::SOAPString
|
1462
|
+
# clientID - SOAP::SOAPString
|
1463
|
+
# templateName - SOAP::SOAPString
|
1464
|
+
# hTMLPageURL - SOAP::SOAPString
|
1465
|
+
# zipFileURL - SOAP::SOAPString
|
1466
|
+
# screenshotURL - SOAP::SOAPString
|
1467
|
+
class TemplateCreate
|
1468
|
+
attr_accessor :apiKey
|
1469
|
+
attr_accessor :clientID
|
1470
|
+
attr_accessor :templateName
|
1471
|
+
attr_accessor :hTMLPageURL
|
1472
|
+
attr_accessor :zipFileURL
|
1473
|
+
attr_accessor :screenshotURL
|
1474
|
+
|
1475
|
+
def initialize(apiKey = nil, clientID = nil, templateName = nil, hTMLPageURL = nil, zipFileURL = nil, screenshotURL = nil)
|
1476
|
+
@apiKey = apiKey
|
1477
|
+
@clientID = clientID
|
1478
|
+
@templateName = templateName
|
1479
|
+
@hTMLPageURL = hTMLPageURL
|
1480
|
+
@zipFileURL = zipFileURL
|
1481
|
+
@screenshotURL = screenshotURL
|
1482
|
+
end
|
1483
|
+
end
|
1484
|
+
|
1485
|
+
# {http://api.createsend.com/api/}Template.CreateResponse
|
1486
|
+
# template_CreateResult - (any)
|
1487
|
+
class TemplateCreateResponse
|
1488
|
+
attr_accessor :template_CreateResult
|
1489
|
+
|
1490
|
+
def initialize(template_CreateResult = nil)
|
1491
|
+
@template_CreateResult = template_CreateResult
|
1492
|
+
end
|
1493
|
+
end
|
1494
|
+
|
1495
|
+
# {http://api.createsend.com/api/}Template.GetDetail
|
1496
|
+
# apiKey - SOAP::SOAPString
|
1497
|
+
# templateID - SOAP::SOAPString
|
1498
|
+
class TemplateGetDetail
|
1499
|
+
attr_accessor :apiKey
|
1500
|
+
attr_accessor :templateID
|
1501
|
+
|
1502
|
+
def initialize(apiKey = nil, templateID = nil)
|
1503
|
+
@apiKey = apiKey
|
1504
|
+
@templateID = templateID
|
1505
|
+
end
|
1506
|
+
end
|
1507
|
+
|
1508
|
+
# {http://api.createsend.com/api/}Template.GetDetailResponse
|
1509
|
+
# template_GetDetailResult - (any)
|
1510
|
+
class TemplateGetDetailResponse
|
1511
|
+
attr_accessor :template_GetDetailResult
|
1512
|
+
|
1513
|
+
def initialize(template_GetDetailResult = nil)
|
1514
|
+
@template_GetDetailResult = template_GetDetailResult
|
1515
|
+
end
|
1516
|
+
end
|
1517
|
+
|
1518
|
+
# {http://api.createsend.com/api/}Template.Update
|
1519
|
+
# apiKey - SOAP::SOAPString
|
1520
|
+
# templateID - SOAP::SOAPString
|
1521
|
+
# templateName - SOAP::SOAPString
|
1522
|
+
# hTMLPageURL - SOAP::SOAPString
|
1523
|
+
# zipFileURL - SOAP::SOAPString
|
1524
|
+
# screenshotURL - SOAP::SOAPString
|
1525
|
+
class TemplateUpdate
|
1526
|
+
attr_accessor :apiKey
|
1527
|
+
attr_accessor :templateID
|
1528
|
+
attr_accessor :templateName
|
1529
|
+
attr_accessor :hTMLPageURL
|
1530
|
+
attr_accessor :zipFileURL
|
1531
|
+
attr_accessor :screenshotURL
|
1532
|
+
|
1533
|
+
def initialize(apiKey = nil, templateID = nil, templateName = nil, hTMLPageURL = nil, zipFileURL = nil, screenshotURL = nil)
|
1534
|
+
@apiKey = apiKey
|
1535
|
+
@templateID = templateID
|
1536
|
+
@templateName = templateName
|
1537
|
+
@hTMLPageURL = hTMLPageURL
|
1538
|
+
@zipFileURL = zipFileURL
|
1539
|
+
@screenshotURL = screenshotURL
|
1540
|
+
end
|
1541
|
+
end
|
1542
|
+
|
1543
|
+
# {http://api.createsend.com/api/}Template.UpdateResponse
|
1544
|
+
# template_UpdateResult - Campaigning::Result
|
1545
|
+
class TemplateUpdateResponse
|
1546
|
+
attr_accessor :template_UpdateResult
|
1547
|
+
|
1548
|
+
def initialize(template_UpdateResult = nil)
|
1549
|
+
@template_UpdateResult = template_UpdateResult
|
1550
|
+
end
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
# {http://api.createsend.com/api/}Template.Delete
|
1554
|
+
# apiKey - SOAP::SOAPString
|
1555
|
+
# templateID - SOAP::SOAPString
|
1556
|
+
class TemplateDelete
|
1557
|
+
attr_accessor :apiKey
|
1558
|
+
attr_accessor :templateID
|
1559
|
+
|
1560
|
+
def initialize(apiKey = nil, templateID = nil)
|
1561
|
+
@apiKey = apiKey
|
1562
|
+
@templateID = templateID
|
1563
|
+
end
|
1564
|
+
end
|
1565
|
+
|
1566
|
+
# {http://api.createsend.com/api/}Template.DeleteResponse
|
1567
|
+
# template_DeleteResult - Campaigning::Result
|
1568
|
+
class TemplateDeleteResponse
|
1569
|
+
attr_accessor :template_DeleteResult
|
1570
|
+
|
1571
|
+
def initialize(template_DeleteResult = nil)
|
1572
|
+
@template_DeleteResult = template_DeleteResult
|
1573
|
+
end
|
1574
|
+
end
|
1575
|
+
|
1414
1576
|
# {http://api.createsend.com/api/}anyType
|
1415
1577
|
class AnyType < ::String
|
1416
1578
|
def initialize(*arg)
|
@@ -176,6 +176,14 @@ class ApiSoap < ::SOAP::RPC::Driver
|
|
176
176
|
:response_style => :document, :response_use => :literal,
|
177
177
|
:faults => {} }
|
178
178
|
],
|
179
|
+
[ "http://api.createsend.com/api/Client.GetTemplates",
|
180
|
+
"getClientTemplates",
|
181
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Client.GetTemplates"]],
|
182
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Client.GetTemplatesResponse"]] ],
|
183
|
+
{ :request_style => :document, :request_use => :literal,
|
184
|
+
:response_style => :document, :response_use => :literal,
|
185
|
+
:faults => {} }
|
186
|
+
],
|
179
187
|
[ "http://api.createsend.com/api/Client.Create",
|
180
188
|
"createClient",
|
181
189
|
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Client.Create"]],
|
@@ -319,6 +327,38 @@ class ApiSoap < ::SOAP::RPC::Driver
|
|
319
327
|
{ :request_style => :document, :request_use => :literal,
|
320
328
|
:response_style => :document, :response_use => :literal,
|
321
329
|
:faults => {} }
|
330
|
+
],
|
331
|
+
[ "http://api.createsend.com/api/Template.Create",
|
332
|
+
"createTemplate",
|
333
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.Create"]],
|
334
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.CreateResponse"]] ],
|
335
|
+
{ :request_style => :document, :request_use => :literal,
|
336
|
+
:response_style => :document, :response_use => :literal,
|
337
|
+
:faults => {} }
|
338
|
+
],
|
339
|
+
[ "http://api.createsend.com/api/Template.GetDetail",
|
340
|
+
"getTemplateDetail",
|
341
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.GetDetail"]],
|
342
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.GetDetailResponse"]] ],
|
343
|
+
{ :request_style => :document, :request_use => :literal,
|
344
|
+
:response_style => :document, :response_use => :literal,
|
345
|
+
:faults => {} }
|
346
|
+
],
|
347
|
+
[ "http://api.createsend.com/api/Template.Update",
|
348
|
+
"updateTemplate",
|
349
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.Update"]],
|
350
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.UpdateResponse"]] ],
|
351
|
+
{ :request_style => :document, :request_use => :literal,
|
352
|
+
:response_style => :document, :response_use => :literal,
|
353
|
+
:faults => {} }
|
354
|
+
],
|
355
|
+
[ "http://api.createsend.com/api/Template.Delete",
|
356
|
+
"deleteTemplate",
|
357
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.Delete"]],
|
358
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://api.createsend.com/api/", "Template.DeleteResponse"]] ],
|
359
|
+
{ :request_style => :document, :request_use => :literal,
|
360
|
+
:response_style => :document, :response_use => :literal,
|
361
|
+
:faults => {} }
|
322
362
|
]
|
323
363
|
]
|
324
364
|
|
@@ -148,6 +148,17 @@ module DefaultMappingRegistry
|
|
148
148
|
]
|
149
149
|
)
|
150
150
|
|
151
|
+
EncodedRegistry.register(
|
152
|
+
:class => Campaigning::Template,
|
153
|
+
:schema_type => XSD::QName.new(NsApi, "Template"),
|
154
|
+
:schema_element => [
|
155
|
+
["templateID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateID")], [0, 1]],
|
156
|
+
["name", ["SOAP::SOAPString", XSD::QName.new(NsApi, "Name")], [0, 1]],
|
157
|
+
["previewURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "PreviewURL")], [0, 1]],
|
158
|
+
["screenshotURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ScreenshotURL")], [0, 1]]
|
159
|
+
]
|
160
|
+
)
|
161
|
+
|
151
162
|
EncodedRegistry.register(
|
152
163
|
:class => Campaigning::List,
|
153
164
|
:schema_type => XSD::QName.new(NsApi, "List"),
|
@@ -243,6 +254,14 @@ module DefaultMappingRegistry
|
|
243
254
|
]
|
244
255
|
)
|
245
256
|
|
257
|
+
EncodedRegistry.register(
|
258
|
+
:class => Campaigning::ArrayOfTemplate,
|
259
|
+
:schema_type => XSD::QName.new(NsApi, "ArrayOfTemplate"),
|
260
|
+
:schema_element => [
|
261
|
+
["template", ["Campaigning::Template[]", XSD::QName.new(NsApi, "Template")], [0, nil]]
|
262
|
+
]
|
263
|
+
)
|
264
|
+
|
246
265
|
EncodedRegistry.register(
|
247
266
|
:class => Campaigning::ArrayOfSubscriberClick,
|
248
267
|
:schema_type => XSD::QName.new(NsApi, "ArrayOfSubscriberClick"),
|
@@ -428,6 +447,17 @@ module DefaultMappingRegistry
|
|
428
447
|
]
|
429
448
|
)
|
430
449
|
|
450
|
+
LiteralRegistry.register(
|
451
|
+
:class => Campaigning::Template,
|
452
|
+
:schema_type => XSD::QName.new(NsApi, "Template"),
|
453
|
+
:schema_element => [
|
454
|
+
["templateID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateID")], [0, 1]],
|
455
|
+
["name", ["SOAP::SOAPString", XSD::QName.new(NsApi, "Name")], [0, 1]],
|
456
|
+
["previewURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "PreviewURL")], [0, 1]],
|
457
|
+
["screenshotURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ScreenshotURL")], [0, 1]]
|
458
|
+
]
|
459
|
+
)
|
460
|
+
|
431
461
|
LiteralRegistry.register(
|
432
462
|
:class => Campaigning::List,
|
433
463
|
:schema_type => XSD::QName.new(NsApi, "List"),
|
@@ -523,6 +553,14 @@ module DefaultMappingRegistry
|
|
523
553
|
]
|
524
554
|
)
|
525
555
|
|
556
|
+
LiteralRegistry.register(
|
557
|
+
:class => Campaigning::ArrayOfTemplate,
|
558
|
+
:schema_type => XSD::QName.new(NsApi, "ArrayOfTemplate"),
|
559
|
+
:schema_element => [
|
560
|
+
["template", ["Campaigning::Template[]", XSD::QName.new(NsApi, "Template")], [0, nil]]
|
561
|
+
]
|
562
|
+
)
|
563
|
+
|
526
564
|
LiteralRegistry.register(
|
527
565
|
:class => Campaigning::ArrayOfSubscriberClick,
|
528
566
|
:schema_type => XSD::QName.new(NsApi, "ArrayOfSubscriberClick"),
|
@@ -953,6 +991,23 @@ module DefaultMappingRegistry
|
|
953
991
|
]
|
954
992
|
)
|
955
993
|
|
994
|
+
LiteralRegistry.register(
|
995
|
+
:class => Campaigning::ClientGetTemplates,
|
996
|
+
:schema_name => XSD::QName.new(NsApi, "Client.GetTemplates"),
|
997
|
+
:schema_element => [
|
998
|
+
["apiKey", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ApiKey")], [0, 1]],
|
999
|
+
["clientID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ClientID")], [0, 1]]
|
1000
|
+
]
|
1001
|
+
)
|
1002
|
+
|
1003
|
+
LiteralRegistry.register(
|
1004
|
+
:class => Campaigning::ClientGetTemplatesResponse,
|
1005
|
+
:schema_name => XSD::QName.new(NsApi, "Client.GetTemplatesResponse"),
|
1006
|
+
:schema_element => [
|
1007
|
+
["client_GetTemplatesResult", [nil, XSD::QName.new(NsApi, "Client.GetTemplatesResult")], [0, 1]]
|
1008
|
+
]
|
1009
|
+
)
|
1010
|
+
|
956
1011
|
LiteralRegistry.register(
|
957
1012
|
:class => Campaigning::ClientCreate,
|
958
1013
|
:schema_name => XSD::QName.new(NsApi, "Client.Create"),
|
@@ -1283,6 +1338,82 @@ module DefaultMappingRegistry
|
|
1283
1338
|
]
|
1284
1339
|
)
|
1285
1340
|
|
1341
|
+
LiteralRegistry.register(
|
1342
|
+
:class => Campaigning::TemplateCreate,
|
1343
|
+
:schema_name => XSD::QName.new(NsApi, "Template.Create"),
|
1344
|
+
:schema_element => [
|
1345
|
+
["apiKey", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ApiKey")], [0, 1]],
|
1346
|
+
["clientID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ClientID")], [0, 1]],
|
1347
|
+
["templateName", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateName")], [0, 1]],
|
1348
|
+
["hTMLPageURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "HTMLPageURL")], [0, 1]],
|
1349
|
+
["zipFileURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ZipFileURL")], [0, 1]],
|
1350
|
+
["screenshotURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ScreenshotURL")], [0, 1]]
|
1351
|
+
]
|
1352
|
+
)
|
1353
|
+
|
1354
|
+
LiteralRegistry.register(
|
1355
|
+
:class => Campaigning::TemplateCreateResponse,
|
1356
|
+
:schema_name => XSD::QName.new(NsApi, "Template.CreateResponse"),
|
1357
|
+
:schema_element => [
|
1358
|
+
["template_CreateResult", [nil, XSD::QName.new(NsApi, "Template.CreateResult")], [0, 1]]
|
1359
|
+
]
|
1360
|
+
)
|
1361
|
+
|
1362
|
+
LiteralRegistry.register(
|
1363
|
+
:class => Campaigning::TemplateGetDetail,
|
1364
|
+
:schema_name => XSD::QName.new(NsApi, "Template.GetDetail"),
|
1365
|
+
:schema_element => [
|
1366
|
+
["apiKey", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ApiKey")], [0, 1]],
|
1367
|
+
["templateID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateID")], [0, 1]]
|
1368
|
+
]
|
1369
|
+
)
|
1370
|
+
|
1371
|
+
LiteralRegistry.register(
|
1372
|
+
:class => Campaigning::TemplateGetDetailResponse,
|
1373
|
+
:schema_name => XSD::QName.new(NsApi, "Template.GetDetailResponse"),
|
1374
|
+
:schema_element => [
|
1375
|
+
["template_GetDetailResult", [nil, XSD::QName.new(NsApi, "Template.GetDetailResult")], [0, 1]]
|
1376
|
+
]
|
1377
|
+
)
|
1378
|
+
|
1379
|
+
LiteralRegistry.register(
|
1380
|
+
:class => Campaigning::TemplateUpdate,
|
1381
|
+
:schema_name => XSD::QName.new(NsApi, "Template.Update"),
|
1382
|
+
:schema_element => [
|
1383
|
+
["apiKey", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ApiKey")], [0, 1]],
|
1384
|
+
["templateID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateID")], [0, 1]],
|
1385
|
+
["templateName", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateName")], [0, 1]],
|
1386
|
+
["hTMLPageURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "HTMLPageURL")], [0, 1]],
|
1387
|
+
["zipFileURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ZipFileURL")], [0, 1]],
|
1388
|
+
["screenshotURL", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ScreenshotURL")], [0, 1]]
|
1389
|
+
]
|
1390
|
+
)
|
1391
|
+
|
1392
|
+
LiteralRegistry.register(
|
1393
|
+
:class => Campaigning::TemplateUpdateResponse,
|
1394
|
+
:schema_name => XSD::QName.new(NsApi, "Template.UpdateResponse"),
|
1395
|
+
:schema_element => [
|
1396
|
+
["template_UpdateResult", ["Campaigning::Result", XSD::QName.new(NsApi, "Template.UpdateResult")], [0, 1]]
|
1397
|
+
]
|
1398
|
+
)
|
1399
|
+
|
1400
|
+
LiteralRegistry.register(
|
1401
|
+
:class => Campaigning::TemplateDelete,
|
1402
|
+
:schema_name => XSD::QName.new(NsApi, "Template.Delete"),
|
1403
|
+
:schema_element => [
|
1404
|
+
["apiKey", ["SOAP::SOAPString", XSD::QName.new(NsApi, "ApiKey")], [0, 1]],
|
1405
|
+
["templateID", ["SOAP::SOAPString", XSD::QName.new(NsApi, "TemplateID")], [0, 1]]
|
1406
|
+
]
|
1407
|
+
)
|
1408
|
+
|
1409
|
+
LiteralRegistry.register(
|
1410
|
+
:class => Campaigning::TemplateDeleteResponse,
|
1411
|
+
:schema_name => XSD::QName.new(NsApi, "Template.DeleteResponse"),
|
1412
|
+
:schema_element => [
|
1413
|
+
["template_DeleteResult", ["Campaigning::Result", XSD::QName.new(NsApi, "Template.DeleteResult")], [0, 1]]
|
1414
|
+
]
|
1415
|
+
)
|
1416
|
+
|
1286
1417
|
LiteralRegistry.register(
|
1287
1418
|
:class => Campaigning::Result,
|
1288
1419
|
:schema_name => XSD::QName.new(NsApi, "Result"),
|
@@ -11,7 +11,8 @@ module Campaigning
|
|
11
11
|
attr_accessor :state
|
12
12
|
attr_accessor :customFields
|
13
13
|
|
14
|
-
def initialize(emailAddress = nil, name = nil, date = nil, state = nil, customFields = nil)
|
14
|
+
def initialize(emailAddress = nil, name = nil, date = nil, state = nil, customFields = nil, opts={})
|
15
|
+
@apiKey = opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY
|
15
16
|
@emailAddress = emailAddress
|
16
17
|
@name = name
|
17
18
|
@date = date
|
@@ -37,7 +38,7 @@ module Campaigning
|
|
37
38
|
#*Error*: An Exception containing the cause of the error will be raised.
|
38
39
|
def add!(list_id, custom_fields={})
|
39
40
|
params = {
|
40
|
-
:apiKey =>
|
41
|
+
:apiKey => @apiKey,
|
41
42
|
:listID => list_id,
|
42
43
|
:email => @emailAddress,
|
43
44
|
:name => @name
|
@@ -70,7 +71,7 @@ module Campaigning
|
|
70
71
|
#*Error*: An Exception containing the cause of the error will be raised.
|
71
72
|
def add_and_resubscribe!(list_id, custom_fields={})
|
72
73
|
params = {
|
73
|
-
:apiKey =>
|
74
|
+
:apiKey => @apiKey,
|
74
75
|
:listID => list_id,
|
75
76
|
:email => @emailAddress,
|
76
77
|
:name => @name
|
@@ -99,15 +100,18 @@ module Campaigning
|
|
99
100
|
#
|
100
101
|
#*Error*: An Exception containing the cause of the error will be raised.
|
101
102
|
def unsubscribe!(list_id)
|
102
|
-
Subscriber.unsubscribe!(@emailAddress, list_id)
|
103
|
+
Subscriber.unsubscribe!(@emailAddress, list_id, :apiKey=> @apiKey)
|
103
104
|
end
|
104
105
|
|
105
106
|
|
106
107
|
#Changes the status of an Active Subscriber to an Unsubscribed Subscriber who will no longer receive
|
107
108
|
#campaigns sent to that Subscriber List (Same that the instance method with the same name).
|
108
|
-
|
109
|
+
#
|
110
|
+
#Aviable _opts_ arguments are:
|
111
|
+
# * :apiKey - optional API key to use to make request. Will use CAMPAIGN_MONITOR_API_KEY if not set.
|
112
|
+
def self.unsubscribe!(email, list_id, opts={})
|
109
113
|
response = @@soap.unsubscribe(
|
110
|
-
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
114
|
+
:apiKey => opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY,
|
111
115
|
:listID => list_id,
|
112
116
|
:email => email
|
113
117
|
)
|
@@ -116,13 +120,16 @@ module Campaigning
|
|
116
120
|
|
117
121
|
#Returns True or False as to the existence of the given email address in the list supplied.
|
118
122
|
def is_subscribed?(list_id)
|
119
|
-
Subscriber.is_subscribed?(@emailAddress, list_id)
|
123
|
+
Subscriber.is_subscribed?(@emailAddress, list_id, :apiKey=> @apiKey)
|
120
124
|
end
|
121
125
|
|
122
126
|
#Returns True or False as to the existence of the given email address in the list supplied.
|
123
|
-
|
127
|
+
#
|
128
|
+
#Aviable _opts_ arguments are:
|
129
|
+
# * :apiKey - optional API key to use to make request. Will use CAMPAIGN_MONITOR_API_KEY if not set.
|
130
|
+
def self.is_subscribed?(email, list_id, opts={})
|
124
131
|
response = @@soap.getIsSubscribed(
|
125
|
-
:apiKey => CAMPAIGN_MONITOR_API_KEY,
|
132
|
+
:apiKey => opts[:apiKey] || CAMPAIGN_MONITOR_API_KEY,
|
126
133
|
:listID => list_id,
|
127
134
|
:email => email
|
128
135
|
)
|
@@ -148,4 +155,4 @@ module Campaigning
|
|
148
155
|
end
|
149
156
|
|
150
157
|
end
|
151
|
-
end
|
158
|
+
end
|