This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
campaign_commander.php
executable file
·3140 lines (2658 loc) · 87.7 KB
/
campaign_commander.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Campaign Commander class
*
* This source file can be used to communicate with Campaign Commander (http://campaigncommander.com)
*
* The class is documented in the file itself. If you find any bugs help me out and report them. Reporting can be done by sending an email to php-campaign-commander-member-bugs[at]verkoyen[dot]eu.
* If you report a bug, make sure you give me enough information (include your code).
*
* Changelog since 1.1.1
* - implemented segmentationCreateSegment
*
* Changelog since 1.1.0
* - bugfix: deleteTestGroup was using a wrong field.
* - extra errorhandling
*
* Changelog since 1.0.0
* - modified the class to reflect the current API.
* - implemented all Message-methods.
* - implemented all URL-management-methods.
* - implemented all test-group-methods.
* - implemented all segment-methods.
* - implemented all campaign-methods.
* - implemented all banner-methods.
* - implemented all banner-link-management-methods.
* - correct casting
* - longs will be converted to string, because if you have a large number of members/campaigns it will overflow.
*
* License
* Copyright (c), Tijs Verkoyen. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
*
* This software is provided by the author "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
*
* @author Tijs Verkoyen <[email protected]>
* @version 1.1.2
*
* @copyright Copyright (c), Tijs Verkoyen. All rights reserved.
* @license BSD License
*/
class CampaignCommander
{
// internal constant to enable/disable debugging
const DEBUG = false;
// URL for the api
const WSDL_URL = 'apiccmd/services/CcmdService?wsdl';
// current version
const VERSION = '1.1.2';
/**
* The API-key that will be used for authenticating
*
* @var string
*/
private $key;
/**
* The login that will be used for authenticating
*
* @var string
*/
private $login;
/**
* The password that will be used for authenticating
*
* @var string
*/
private $password;
/**
* The server to use
*
* @var string
*/
private $server = 'http://emvapi.emv3.com';
/**
* The SOAP-client
*
* @var SoapClient
*/
private $soapClient;
/**
* The token
*
* @var string
*/
private $token = null;
/**
* The timeout
*
* @var int
*/
private $timeOut = 60;
/**
* The user agent
*
* @var string
*/
private $userAgent;
// class methods
/**
* Default constructor
*
* @return void
* @param string $login Login provided for API access.
* @param string $password The password.
* @param string $key Manager Key copied from the CCMD web application.
* @param string[optional] $server The server to use. Ask your account-manager.
*/
public function __construct($login, $password, $key, $server = null)
{
$this->setLogin($login);
$this->setPassword($password);
$this->setKey($key);
if($server !== null) $this->setServer($server);
}
/**
* Destructor
*
* @return void
*/
public function __destruct()
{
// is the connection open?
if($this->soapClient !== null)
{
try
{
// close
$this->closeApiConnection();
}
// catch exceptions
catch(Exception $e)
{
// do nothing
}
// reset vars
$this->soapClient = null;
$this->token = null;
}
}
/**
* Make the call
*
* @return mixed
* @param string $method The method to be called.
* @param array[optional] $parameters The parameters.
*/
private function doCall($method, array $parameters = array())
{
// open connection if needed
if($this->soapClient === null || $this->token === null)
{
// build options
$options = array('soap_version' => SOAP_1_1,
'trace' => self::DEBUG,
'exceptions' => true,
'connection_timeout' => $this->getTimeOut(),
'user_agent' => $this->getUserAgent(),
'typemap' => array(
array('type_ns' => 'http://www.w3.org/2001/XMLSchema', 'type_name' => 'long', 'to_xml' => array(__CLASS__, 'toLongXML'), 'from_xml' => array(__CLASS__, 'fromLongXML')) // map long to string, because a long can cause an integer overflow
)
);
// create client
$this->soapClient = new SoapClient($this->getServer() . '/' . self::WSDL_URL, $options);
// build login parameters
$loginParameters['login'] = $this->getLogin();
$loginParameters['pwd'] = $this->getPassword();
$loginParameters['key'] = $this->getKey();
// make the call
$response = $this->soapClient->__soapCall('openApiConnection', array($loginParameters));
// validate
if(is_soap_fault($response))
{
// init var
$message = 'Internal Error';
// more detailed message available
if(isset($response->detail->ConnectionServiceException->description)) $message = (string) $response->detail->ConnectionServiceException->description;
// invalid token?
if($message == 'Please enter a valid token to validate your connection.')
{
// reset token
$this->token = null;
// try again
return self::doCall($method, $parameters);
}
// internal debugging enabled
if(self::DEBUG)
{
echo '<pre>';
echo 'last request<br />';
var_dump($this->soapClient->__getLastRequest());
echo 'response<br />';
var_dump($response);
echo '</pre>';
}
// throw exception
throw new CampaignCommanderException($message);
}
// validate response
if(!isset($response->return)) throw new CampaignCommanderException('Invalid response');
// set token
$this->token = (string) $response->return;
}
// redefine
$method = (string) $method;
$parameters = (array) $parameters;
// loop parameters
foreach($parameters as $key => $value)
{
// strings should be UTF8
if(gettype($value) == 'string') $parameters[$key] = utf8_encode($value);
}
// add token
$parameters['token'] = $this->token;
try
{
// make the call
$response = $this->soapClient->__soapCall($method, array($parameters));
}
catch(Exception $e)
{
// init var
$message = $e->getMessage();
// internal debugging enabled
if(self::DEBUG)
{
echo '<pre>';
var_dump(htmlentities($this->soapClient->__getLastRequest()));
var_dump($this);
echo '</pre>';
}
// throw exception
throw new CampaignCommanderException($message);
}
// validate response
if(is_soap_fault($response))
{
// init var
$message = 'Internal Error';
// more detailed message available
if(isset($response->detail->ConnectionServiceException->description)) $message = (string) $response->detail->ConnectionServiceException->description;
if(isset($response->detail->MemberServiceException->description)) $message = (string) $response->detail->MemberServiceException->description;
if(isset($response->detail->CcmdServiceException->description))
{
$message = (string) $response->detail->CcmdServiceException->description;
if(isset($response->detail->CcmdServiceException->fields)) $message .= ' fields: ' . $response->detail->CcmdServiceException->fields;
if(isset($response->detail->CcmdServiceException->status)) $message .= ' status: ' . $response->detail->CcmdServiceException->status;
}
// internal debugging enabled
if(self::DEBUG)
{
echo '<pre>';
var_dump(htmlentities($this->soapClient->__getLastRequest()));
var_dump($this);
echo '</pre>';
}
// throw exception
throw new CampaignCommanderException($message);
}
// empty reply
if(!isset($response->return)) return null;
// return the response
return $response->return;
}
/**
* Convert a long into a string
*
* @return string
* @param string $value The value to convert.
*/
public static function fromLongXML($value)
{
return (string) strip_tags($value);
}
/**
* Convert a x into a long
*
* @return string
* @param string $value The value to convert.
*/
public static function toLongXML($value)
{
return '<long>' . $value . '</long>';
}
/**
* Get the key
*
* @return string
*/
private function getKey()
{
return (string) $this->key;
}
/**
* Get the login
*
* @return string
*/
private function getLogin()
{
return (string) $this->login;
}
/**
* Get the password
*
* @return string
*/
private function getPassword()
{
return $this->password;
}
/**
* Get the server
*
* @return string
*/
private function getServer()
{
return $this->server;
}
/**
* Get the timeout that will be used
*
* @return int
*/
public function getTimeOut()
{
return (int) $this->timeOut;
}
/**
* Get the useragent that will be used. Our version will be prepended to yours.
* It will look like: "PHP Campaign Commander/<version> <your-user-agent>"
*
* @return string
*/
public function getUserAgent()
{
return (string) 'PHP Campaign Commander/' . self::VERSION . ' ' . $this->userAgent;
}
/**
* Set the Key that has to be used
*
* @return void
* @param string $key The key to set.
*/
private function setKey($key)
{
$this->key = (string) $key;
}
/**
* Set the login that has to be used
*
* @return void
* @param string $login The login to use.
*/
private function setLogin($login)
{
$this->login = (string) $login;
}
/**
* Set the password that has to be used
*
* @return void
* @param string $password The password to use.
*/
private function setPassword($password)
{
$this->password = (string) $password;
}
/**
* Set the server that has to be used.
*
* @return void
* @param string $server The server to use.
*/
private function setServer($server)
{
$this->server = (string) $server;
}
/**
* Set the timeout
* After this time the request will stop. You should handle any errors triggered by this.
*
* @return void
* @param int $seconds The timeout in seconds.
*/
public function setTimeOut($seconds)
{
$this->timeOut = (int) $seconds;
}
/**
* Set the user-agent for you application
* It will be appended to ours, the result will look like: "PHP Campaign Commander/<version> <your-user-agent>"
*
* @return void
* @param string $userAgent Your user-agent, it should look like <app-name>/<app-version>.
*/
public function setUserAgent($userAgent)
{
$this->userAgent = (string) $userAgent;
}
// connection methods
/**
* Close the connection
*
* @return bool true if the connection was closes, otherwise false.
*/
public function closeApiConnection()
{
// make the call
$response = $this->doCall('closeApiConnection');
// validate response
if($response == 'connection closed')
{
// reset vars
$this->soapClient = null;
$this->token = null;
return true;
}
// fallback
return false;
}
// message methods
/**
* Create email-message.
*
* @return string The message ID.
* @param string $name Name of the message.
* @param string $description Description of the message.
* @param string $subject Subject of the message.
* @param string $from From name.
* @param string $fromEmail From email-address.
* @param string $to To name.
* @param string $body Body of the email.
* @param string $encoding Encoding to use.
* @param string $replyTo Reply-to name.
* @param string $replyToEmail Reply-to email.
* @param bool[optional] $bounceback Use as bounceback message?
* @param bool[optional] $unsubscribe Use unsubscribe feature of Windows Live Mail.
* @param string[optional] $unsublinkpage Unjoin URL, imporve deliverability displaying a unsubscribe button in Windows Live Mail.
*/
public function createEmailMessage($name, $description, $subject, $from, $fromEmail, $to, $body, $encoding, $replyTo, $replyToEmail, $bounceback = false, $unsubscribe = false, $unsublinkpage = null)
{
// build parameters
$parameters = array();
$parameters['name'] = (string) $name;
$parameters['description'] = (string) $description;
$parameters['subject'] = (string) $subject;
$parameters['from'] = (string) $from;
$parameters['fromEmail'] = (string) $fromEmail;
$parameters['to'] = (string) $to;
$parameters['body'] = (string) $body;
$parameters['encoding'] = (string) $encoding;
$parameters['replyTo'] = (string) $replyTo;
$parameters['replyToEmail'] = (string) $replyToEmail;
$parameters['isBounceback'] = ($bounceback) ? '1' : '0';
$parameters['hotmailUnsubFlg'] = ($unsubscribe) ? '1' : '0';
if($unsublinkpage !== null) $parameters['hotmailUnsubUrl'] = (string) $unsublinkpage;
// make the call
return (string) $this->doCall('createEmailMessage', $parameters);
}
/**
* Create email-message.
* @remark you have to specify an id-element width value 0.
*
* @return string The message ID.
* @param array $message The message object.
*/
public function createEmailMessageByObj($message)
{
// build parameters
$parameters = array();
$parameters['message'] = $message;
// make the call
return $this->doCall('createEmailMessageByObj', $parameters);
}
/**
* Create SMS-message.
*
* @return string The message ID.
* @param string $name Name of the message.
* @param string $desc Description of the message.
* @param string $from From name.
* @param string $body Body of the SMS.
*/
public function createSmsMessage($name, $desc, $from, $body)
{
// build parameters
$parameters = array();
$parameters['name'] = (string) $name;
$parameters['desc'] = (string) $desc;
$parameters['from'] = (string) $from;
$parameters['body'] = (string) $body;
// make the call
return (string) $this->doCall('createSMSMessage', $parameters);
}
/**
* Create SMS-message.
* @remark you have to specify an id-element width value 0.
*
* @return string The message ID.
* @param array $message The message object.
*/
public function createSmsMessageByObj(array $message)
{
// build parameters
$parameters = array();
$parameters['message'] = $message;
// make the call
return $this->doCall('createSmsMessageByObj', $parameters);
}
/**
* Delete message.
*
* @return bool true if delete was successful.
* @param string $id ID of the message.
*/
public function deleteMessage($id)
{
// build parameters
$parameters = array();
$parameters['id'] = $id;
// make the call
return (bool) $this->doCall('deleteMessage', $parameters);
}
/**
* Update a message field.
*
* @return bool true if the update was successful.
* @param string $id ID of the message.
* @param string $field The field to update.
* @param mixed $value The value to set.
*/
public function updateMessage($id, $field, $value)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
$parameters['field'] = (string) $field;
$parameters['value'] = $value;
// make the call
return (bool) $this->doCall('updateMessage', $parameters);
}
/**
* Update email-message.
*
* @return bool true if the update was successful.
* @param array $message The message object.
*/
public function updateMessageByObj(array $message)
{
// build parameters
$parameters = array();
$parameters['message'] = $message;
// make the call
return $this->doCall('updateMessageByObj', $parameters);
}
/**
* Clone a message.
*
* @return string ID of the newly created message.
* @param string $id ID of the message.
* @param string $newName Name of the newly created message.
*/
public function cloneMessage($id, $newName)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
$parameters['newName'] = (string) $newName;
// make the call
return (string) $this->doCall('cloneMessage', $parameters);
}
/**
* Get message.
*
* @return object The message object.
* @param string $id ID of the message.
*/
public function getMessage($id)
{
// build parameters
$parameters['id'] = (string) $id;
// make the call
return $this->doCall('getMessage', $parameters);
}
/**
* Get last email-messages.
*
* @return array IDs of messages.
* @param int $limit Maximum number of messages to retrieve.
*/
public function getLastEmailMessages($limit)
{
// build parameters
$parameters['limit'] = (int) $limit;
// make the call
return (array) $this->doCall('getLastEmailMessages', $parameters);
}
/**
* Get last SMS-messages.
*
* @return array IDs of messages.
* @param int $limit Maximum number of messages to retrieve.
*/
public function getLastSmsMessages($limit)
{
// build parameters
$parameters['limit'] = (int) $limit;
// make the call
return (array) $this->doCall('getLastSmsMessages', $parameters);
}
/**
* Get email-messages by field.
*
* @return array IDs of messages matching the search.
* @param string $field Field to search.
* @param mixed $value Value to search.
* @param int $limit Maximum number of messages to retrieve.
*/
public function getEmailMessagesByField($field, $value, $limit)
{
// build parameters
$parameters = array();
$parameters['field'] = (string) $field;
$parameters['value'] = $value;
$parameters['limit'] = (int) $limit;
// make the call
return (array) $this->doCall('getEmailMessagesByField', $parameters);
}
/**
* Get SMS-messages by field.
*
* @return array IDs of messages matching the search.
* @param string $field Field to search.
* @param mixed $value Value to search.
* @param int $limit Maximum number of messages to retrieve.
*/
public function getSmsMessagesByField($field, $value, $limit)
{
// build parameters
$parameters = array();
$parameters['field'] = (string) $field;
$parameters['value'] = $value;
$parameters['limit'] = (int) $limit;
// make the call
return (array) $this->doCall('getSmsMessagesByField', $parameters);
}
/**
* Get messages by period.
*
* @return array IDs of messages matching the search.
* @param int $dateBegin Begin date of the period.
* @param int $dateEnd End date of the period.
*/
public function getMessagesByPeriod($dateBegin, $dateEnd)
{
// build parameters
$parameters['dateBegin'] = date('Y-m-d H:i:s', (int) $dateBegin);
$parameters['dateEnd'] = date('Y-m-d H:i:s', (int) $dateEnd);
// make the call
return (array) $this->doCall('getMessagesByPeriod', $parameters);
}
/**
* Get email-message preview.
*
* @return string Preview of the message.
* @param string $messageId ID of the message.
* @param string[optional] $part Part of the message to preview (HTML or text).
*/
public function getEmailMessagePreview($messageId, $part = 'HTML')
{
// validate
$allowedParts = array('HTML', 'text');
if(!in_array($part, $allowedParts)) throw new CampaignCommanderException('Invalid part (' . $part . '), allowed values are: ' . implode(', ', $allowedParts) . '.');
// build parameters
$parameters = array();
$parameters['id'] = (string) $messageId;
$parameters['part'] = $part;
// make the call
return (string) $this->doCall('getEmailMessagePreview', $parameters);
}
/**
* Get SMS-message preview.
*
* @return string Preview of the SMS-message.
* @param string $messageId ID of the message.
*/
public function getSmsMessagePreview($messageId)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $messageId;
// make the call
return (string) $this->doCall('getSmsMessagePreview', $parameters);
}
/**
* Activate tracking for all links.
*
* @return array
* @param string $id ID of the message.
*/
public function trackAllLinks($id)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
// make the call
return $this->doCall('trackAllLinks', $parameters);
}
/**
* Deactivate link tracking for all links.
*
* @return bool true if the untrack operation was successful.
* @param string $id ID of the message.
*/
public function untrackAllLinks($id)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
// make the call
return $this->doCall('untrackAllLinks', $parameters);
}
/**
* Tracks a link based on its position in an email.
*
* @return array The order number of the URL.
* @param string $id ID of the message.
* @param string $position Position of the link to update in the message.
* @param string[optional] $part HTML or text.
*/
public function trackLinkByPosition($id, $position, $part = 'HTML')
{
// @todo validate
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
$parameters['position'] = (string) $position;
$parameters['part'] = (string) $part;
// make the call
return $this->doCall('trackLinkByPosition', $parameters);
}
/**
* Get a list of all teh tracked links in an email.
*
* @return array List of IDs of the tracked links.
* @param string $id ID of the message.
*/
public function getAllTrackedLinks($id)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
// make the call
return (array) $this->doCall('getAllTrackedLinks', $parameters);
}
/**
* Retrieves the unused tracked links for an email.
*
* @return array List of IDs of the unused tracked links.
* @param string $id ID of the message.
*/
public function getAllUnusedTrackedLinks($id)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
// make the call
return (array) $this->doCall('getAllUnusedTrackedLinks', $parameters);
}
/**
* Retrieves all the trackable links in an email.
*
* @return array List of IDs of the trackable links.
* @param string $id ID of the message.
*/
public function getAllTrackableLinks($id)
{
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
// make the call
return (array) $this->doCall('getAllTrackableLinks', $parameters);
}
/**
* Sends a test email campaign to a group of recipients.
*
* @return true if successfull, false otherwise.
* @param string $id The ID of the message to test.
* @param string $groupId The ID of the group to use for the test.
* @param string $campaignName The name of the test campaign.
* @param string $subject The subject of the message to test.
* @param string[optional] $part The part of the message to send, allowed values are: HTML, TXT, MULTIPART.
*/
public function testEmailMessageByGroup($id, $groupId, $campaignName, $subject, $part = 'MULTIPART')
{
// @todo validate
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
$parameters['groupId'] = (string) $groupId;
$parameters['campaignName'] = (string) $campaignName;
$parameters['subject'] = (string) $subject;
$parameters['part'] = (string) $part;
// make the call
return $this->doCall('testEmailMessageByGroup', $parameters);
}
/**
* Sends a test email campaign to a member.
*
* @return true if successfull, false otherwise.
* @param string $id The ID of the message to test.
* @param string $memberId The ID of the member to use for the test.
* @param string $campaignName The name of the test campaign.
* @param string $subject The subject of the message to test.
* @param string[optional] $part The part of the message to send, allowed values are: HTML, TXT, MULTIPART.
*/
public function testEmailMessageByMember($id, $memberId, $campaignName, $subject, $part = 'MULTIPART')
{
// @todo validate
// build parameters
$parameters = array();
$parameters['id'] = (string) $id;
$parameters['memberId'] = (string) $memberId;
$parameters['campaignName'] = (string) $campaignName;
$parameters['subject'] = (string) $subject;
$parameters['part'] = (string) $part;
// make the call
return $this->doCall('testEmailMessageByMember', $parameters);
}
/**
* Sends a test email campaign to a member.
*
* @return true if successfull, false otherwise.
* @param string $id The ID of the message to test.
* @param string $memberId The ID of the member to use for the test.
* @param string $campaignName The name of the test campaign.