forked from stojce/hifi-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpha.php
46 lines (42 loc) · 1.52 KB
/
alpha.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
<?php
require_once('config.php');
View::write('page', 'alpha');
View::$footer = 'layout/empty/footer';
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['email']) {
$MailChimp = new MailChimp(MC_ALPHA_SUBSCRIBE_API_KEY);
$result = $MailChimp->call('lists/subscribe', array(
'id' => MC_ALPHA_SUBSCRIBE_LIST_ID,
'email' => array('email' => $_POST['email']),
'merge_vars' => array(
'MERGE1' => $_POST['fname'],
'MERGE2' => $_POST['lname'],
'MERGE5' => $_POST['city'],
'MERGE3' => $_POST['connection'],
'MERGE4' => $_POST['country'],
'GROUPINGS' => array(
0 => array(
'name' => 'Devices',
'groups' => array_keys($_POST['group']['Devices'])
)
)
),
'double_optin' => true,
'update_existing' => true,
'replace_interests' => false,
'send_welcome' => false
));
$title = 'Subscription success';
$view = 'alpha_success';
View::$header = 'layout/empty/header';
View::addStyle('css/alpha_success.css');
} else {
$title = 'High Fidelity Alpha Signup';
$view = 'alpha';
View::addScript('js/alpha.js');
View::addScript('js/chosen/chosen.jquery.min.js');
View::addScript('js/validate/jquery.validate.min.js');
View::addStyle('css/alpha.css');
View::addStyle('css/chosen/chosen.min.css');
}
View::$title = $title;
View::renderCommonLayout($view);