25 lines
742 B
PHP
25 lines
742 B
PHP
<?php
|
|
// inspired by https://www.mailgun.com/blog/email/double-opt-in-with-php-mailgun/
|
|
|
|
function AddMemberToDB($recipientAddress) {
|
|
/* global $mailingList, $mgClient;
|
|
$result = $mgClient->post("lists/$mailingList/members", array(
|
|
'address' => $recipientAddress,
|
|
'name' => $recipientName,
|
|
'description' => 'Form Opt In',
|
|
'subscribed' => true
|
|
)); */
|
|
}
|
|
|
|
|
|
require("settings.php");
|
|
|
|
$c = isset($_GET['c']) ? SanitizeInputs($_GET['c']) : NULL;
|
|
$e = isset($_GET['e']) ? SanitizeInputs($_GET['e']) : NULL;
|
|
|
|
if (isset($c) && isset($e) && CheckConfirmationHash($e, $c) && AddMemberToDB($e)) {
|
|
header('Location: /newsletter/confirmed.html');
|
|
} else {
|
|
header('Location: /newsletter/confirm-error.html')
|
|
}
|
|
?>
|