-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtester.php
More file actions
27 lines (24 loc) · 771 Bytes
/
Copy pathtester.php
File metadata and controls
27 lines (24 loc) · 771 Bytes
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
<?php
// include cass
include_once('bb_mailchimp.php');
// define template
$dataTemplate = [
'email_address' => '',
'merge_fields' => [
'FNAME'=>'',
'LNAME'=>''
],
'tags' => [],
'status' => 'subscribed'
];
// customize template
$data = $dataTemplate;
$data['email_address'] = 'email_address_to_subscribe';
$data['merge_fields']['FNAME'] = "first_name";
$data['merge_fields']['LNAME'] = "last_name";
$data['tags'] = Array('tag1','tag2');
// subscribe user
$apiKey = "";
$listId = "";
$bb_mc = new BB_MailChimp($apiKey,$listId);
$bb_mc->subscribeToMailChimp($data);