suppressedListBatchUnsubscribe()

Emails from the Global Suppression List (GSL) are removed. Array of recipients’ emails is passed

suppressedListBatchUnsubscribe(array $emails) : struct

Emails suppressed only by you can be removed from GSL. This function will produce errors on emails that unsubscribed from all your listings by themselves.
Input parameters
  • emails - array of emails
Information obtained

Array consisting of:

  • success_count - number of successfully removed emails
  • error_count - number of unsuccessfully removed emails
  • errors - array of error messages about each email. Each error message is represented as an array consisting of fields:
    • code - error code
    • message - error message
    • email - email address that raised error

Examples

mgapi_suppressedListBatchUnsubscribe.php
<?php
/**
 * This Example shows how to suppressedListBatchUnsubscribe using the MGAPI.php class and do some basic error checking.
 */
require_once 'inc/MGAPI.class.php';
require_once 'inc/config.inc.php'; //contains apikey
 
$api = new MGAPI($apikey);
 
$emails = array($my_email, $boss_man_email);
 
$retval = $api->suppressedListBatchUnsubscribe($emails);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load suppressedListBatchUnsubscribe()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "success:" . $retval['success_count'] . "\n";
    echo "errors:" . $retval['error_count'] . "\n";
    foreach ($retval['errors'] as $val) {
        echo "\t*" . $val['email'] . " failed\n";
        echo "\tcode:" . $val['code'] . "\n";
        echo "\tmsg :" . $val['message'] . "\n\n";
    }
}

© 2010-2018 Mailigen. All rights reserved.