-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
52 lines (44 loc) · 1.42 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
46
47
48
49
50
51
52
<?php
require_once("credentials.php");
require_once("MailchimpAPI.php");
$mailchimpAPI = new MailchimpAPI($API_KEY);
$data = array(
'name' => 'name3',
'contact' => array(
'company' => 'company name',
'address1' => 'calle 15',
'city' => 'Your City',
'state' => 'CO',
'zip' => 'zipcode',
'country' => 'Colombia'
),
'permission_reminder' => 'permission reminder message',
'campaign_defaults' => array(
'from_name' => 'name from',
'from_email' => 'correo@hotmail.com',
'subject' => '',
'language' => 'en'
),
'email_type_option' => true
);
$result0 = $mailchimpAPI->createList($data);
//echo $result0;
$mailchimpAPI->getLists();
$contacts = array (
array(
"email_address" => "example@dominio.com",
"name" => "Nombres",
"last_name" => "apellidos"
),
array(
"email_address" => "example1@dominio.com",
"name" => "Nombres1",
"last_name" => "apellidos1"
)
);
$listId = "339c24fe44";
$finalData = $mailchimpAPI->setContactsList($contacts, $listId);
$mailchimpAPI->sendContactsList($finalData);
$result1 = $mailchimpAPI->deleteList($listId);
echo $result1["message"];
?>