-
Notifications
You must be signed in to change notification settings - Fork 1
/
phplistHostedClient.class.php
82 lines (63 loc) · 2.47 KB
/
phplistHostedClient.class.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
<?php
error_reporting(E_ALL & ~ E_NOTICE & ~ E_DEPRECATED);
/*
* SOAP client for phpList Hosted
*
* version 0.1 - 2011-07-20, Michiel Dethmers phpList Ltd
*
* requires nuSoap: http://sourceforge.net/projects/nusoap/
* unpack nuSoap in ./lib/
*
* for more info https://www.phplist.com/contactus
*
*/
class phpListHostedSoapClient {
private $soap_url = '';
private $soap;
function phpListHostedSoapClient($soap_url) {
$this->soap_url = $soap_url;
$this->xCreateSoap();
}
function getMessageLittleStats($message_id) {
return $this->soap->call('phpListHosted.getMessageLittleStats', array('message_id' => $message_id));
}
function getListIdByName($list_name) {
return $this->soap->call('phpListHosted.getListIdByName', array('list_name' => $list_name));
}
function createNewList($name, $description) {
return $this->soap->call('phpListHosted.createNewList', array('name' => $name, 'description' => $description));
}
function addListToCategory($list_id,$category_name) {
return $this->soap->call('phpListHosted.addListToCategory', array('list_id' => $list_id, 'category_name' => $category_name));
}
function submitMessage($messageid) {
return $this->soap->call('phpListHosted.submitMessage', array('msg_id' => $messageid));
}
function HelloWorld() {
return $this->soap->call('phpListHosted.HelloWorld', array());
}
function xCreateSoap() {
if (is_null($this->soap)) {
require(dirname(__FILE__)."/lib/nusoap.php");
$this->soap = new nusoap_client($this->soap_url);
}
}
function addEmail($email,$list) {
return $this->soap->call('phpListHosted.insertNewUser', array(
array($email),$list));
}
function removeEmailsFromList($list_id,$emails) {
return $this->soap->call('phpListHosted.removeEmailsFromList', array(
'list_id' => $list_id,'array_email' => $emails));
}
function isListSubscriber($email,$list_id) {
return $this->soap->call('phpListHosted.isListSubscriber', array(
'email' => $email,'list_id' => $list_id));
}
function createHtmlMessage($subject, $content, $from_field, $footer, $list_id) {
return $this->soap->call('phpListHosted.createHtmlMessage',array($subject, $content, $from_field, $footer, $list_id));
}
function updateHtmlMessage($message_id, $subject, $content, $from_field, $footer, $list_id) {
return $this->soap->call('phpListHosted.updateHtmlMessage',array($message_id, $subject, $content, $from_field, $footer, $list_id));
}
}