listBatchUnsubscribeSMS()

Phone numbers from the selected list are deleted. Array of recipients’ phone numbers with additional parameters are passed, which determine whether a notification about phone number removal will or will not be sent.

listBatchUnsubscribeSMS(string $id, array $phones, boolean $delete_member, boolean $send_notify) : struct
Input parameters
  • id - list ID
  • phones - array of phone numbers
  • delete_member - whether recipient is deleted from existing list (true, false) (optional). Default value is false.
  • send_notify - whether notification is sent to sender email which is indicated for a particular list (true, false) (optional). Default value is false.

Information obtained


Array consisting of:

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

Examples

mgapi_listBatchUnsubscribeSMS.php
listBatchUnsubscribeSMS($id, $phones, $delete_member, $send_notify);
 
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load listBatchUnsubscribeSMS()!\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['phone'] . " failed\n";
        echo "\tcode:" . $val['code'] . "\n";
        echo "\tmsg :" . $val['message'] . "\n\n";
    }
}

© 2010-2017 Mailigen. All rights reserved.