/*

Template name: Unsubscribe

*/

function sendQuery($post = array(), $posturl = 'https://www.elabs3.com/API/mailing_list.html')

{

$postparts = array();

foreach( $post as $key=>$value ) {

$postparts[] = $key . ‘=’ . urlencode($value);

}

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $posturl);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, implode(‘&’, $postparts));

curl_setopt($ch, CURLINFO_CONTENT_TYPE, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

$results = curl_exec($ch);

curl_close($ch);

return $results . “\n”;

}

$sel = empty($_REQUEST[‘sel’]) ? 81823 : $_REQUEST[‘sel’];

$dids = array(

81823 => ‘ FOLIO advertiser emails’,

81828 => ‘ FOLIO book emails’,

81824 => ‘ FOLIO conference emails’,

81825 => ‘ FOLIO Contest emails’,

81826 => ‘ FOLIO Job Board emails’,

81829 => ‘ FOLIO subscriber emails’,

81830 => ‘ FOLIO subscription emails’,

81827 => ‘ FOLIO third party emails’,

81831 => ‘ FOLIO training emails’,

81832 => ‘ other AI Products emails from FOLIO’,

81974 => ‘ all min/Folio/Expo’,

82488 => ‘ the FOLIO Top 5 Eletter’,

82483 => ‘ FOLIO Webinar emails’,

81944 => ‘ all FOLIO emails’,

82486 => ‘ FOLIO Alert’,

82987 => ‘ Folio MediaNext Conference’,

72025 => ‘ FOLIO Award Entries’,

72020 => ‘ FOLIO Award Events’,

);

if ( !empty($_POST[‘email’]) ) {

if ( $_POST[‘action’] == ‘unsubscribe’ ) {

if ( $_POST[‘sel’] == ‘all’ ) {

foreach( $dids as $did=>$sdfsdf ) {

$unsubscribeXML .= ‘off‘ . “\n”;

}

}

else {

$unsubscribeXML .= ‘on‘ . “\n”;

}

}

$posturl = ‘https://www.elabs3.com/API/mailing_list.html';

$site_id = ‘669262’;

$mlid = ‘288396’;

$email = $_POST[‘email’];

$req[‘type’] = ‘record';

$req[‘activity’] = ‘update';

$req[‘input’] =

‘.$site_id.’‘;

$req[‘input’] .= !empty($mlid) ? (‘‘.$mlid.’‘) : ”;

$req[‘input’] .= $unsubscribeXML.’

‘.$email.’

Accessintel

‘;

$data = sendQuery($req, $posturl);

$parser = xml_parser_create(‘UTF-8′);

xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);

xml_parse_into_struct($parser, $data, $vals, $index);

xml_parser_free($parser);

foreach( $vals as $val ) {

if ( $val[‘tag’] == ‘TYPE’ && $val[‘value’] == ‘error’ ) {

$error = true;

}

if ( $val[‘tag’] == ‘DATA’ ) {

$errormsg = ‘

‘ . $val[‘value’]. ‘

‘;

}

}

if ( !$error ) {
//header(‘Location:/unsubscribe-success/’);
if ( $_POST[‘sel’] == ‘all’ ) {
$success = ‘

You have successfully unsubscribed from all FOLIO emails.

‘;
}
else {
$success = ‘

You have successfully unsubscribed from ‘. $dids[$sel] . ‘.

‘; }
//exit;
}

}

?>

FOLIO: Magazine E-Mail Unsubscribe

if ( !empty($success) ) {

echo $success;

}

else {

if ( !empty($error) ) {

echo $errormsg;

}

?>

You have requested to unsubscribe from .

To unsubscribe please enter your email address here:

‘ />

As a reminder, FOLIO offerings include a wide range of resources for media professionals, including FOLIO Blog, award programs, webinars, networking events and workshops so you can learn and grow in your career. Below is a list of resources available to you from the FOLIO network. I encourage you to look around the site and explore the many ways we can meet your needs and help you grow professionally.

FOLIO
Learn More / Subscribe now

foliomag.com
Community hub for all our
upcoming
programs and
resources at Folio
Go There Now

FOLIO: Webinars
Cost-effective way to train your
team on timely programs
Upcoming Webinars

FOLIO Awards Programs
Awarding top talent and creativity
in the media industry
Upcoming Award Programs

MEDIA Jobs
Post jobs and find jobs
Visit Now

Thank you for being part of the FOLIO: community. If you have any questions about FOLIO: services or the unsubscribe process, please send an email to dsikes@accessintel.com

}

?>