-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.php
45 lines (33 loc) · 1.3 KB
/
example.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
<?php
use EricKertz\Libraries\ResponsysLibrary;
class ResponsysController {
protected $responsysLibrary;
public function __construct(ResponsysLibrary $responsysLibrary)
{
$this->responsysLibrary = $responsysLibrary;
}
public function create()
{
$emailAddress = "your_email_address@your_domain.com";
$firstName = "your_first_name";
// login as api user
$this->responsysLibrary->setUsername('YOUR_USER_NAME');
$this->responsysLibrary->setPassword('**************');
$login = $this->responsysLibrary->login();
// add member to list
$this->responsysLibrary->setMyFolderName('YOUR_FOLDER_NAME');
$this->responsysLibrary->setMyTableName('YOUR_TABLE_NAME');
$fields = array('EMAIL_ADDRESS_', 'FIRST_NAME');
$values = array($emailAddress, $firstName);
$this->responsysLibrary->setReqArgsMember($fields,$values);
$mergeListMembers = $this->responsysLibrary->mergeListMembers();
// trigger campaign email
$this->responsysLibrary->setMyCampName('YOUR_CAMPAIGN_NAME');
$this->responsysLibrary->setMyCampFolderName('YOUR_CAMPAIGN_FOLDER_NAME');
$this->responsysLibrary->setReqArgsMessage();
$this->responsysLibrary->setRecipient($emailAddress);
$triggerCampaignMessage = $this->responsysLibrary->triggerCampaignMessage();
// logout
$this->responsysLibrary->logout();
}
}