-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
39 lines (25 loc) · 1.28 KB
/
README
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
EmailLabsAPI.php is a class that contains wrappers for several API functions for the Email Service Provider Lyris (nee EmailLabs).
http://github.com/elidickinson/EmailLabsAPI
Requires your PHP to be compiled with binding for cURL because we use that to POST data. Also requires DOMDocument classes in PHP, which should be compiled in by default (unless you did --disable-dom)
Example:
<?php
require_once("EmailLabsAPI.php");
$api = new EmailLabsAPI();
$api->config['siteid'] = 1234; // Your site ID goes here!
$email = '[email protected]';
// This is the Mailing List ID for the list you've created in EmailLabs
$mlid = 123456;
// Demographics is an array where the keys are the ID of the field and the value is, well, the value. These
// demographics must already be added the the given mailing list.
$demographics = array('1'=> 'Eli', '2'=>'Dickinson', '47'=>'Software Developer');
// Demographics ID 1 is First Name, 2 is Last Name... see demographcis page in EmailLabs for more
// Control whether or not to send a welcome message to this person (assuming one is configured) in EmailLabs
$send_welcome = TRUE;
$api_result = $api->subscribe($email, $mlid, $demographics, $send_welcome);
if($result) {
print "Congrats, You're subscribed!";
}
else {
print "Error, unable to subscribe!";
}
?>