本文整理汇总了PHP中MCAPI::campaignAbuseReports方法的典型用法代码示例。如果您正苦于以下问题:PHP MCAPI::campaignAbuseReports方法的具体用法?PHP MCAPI::campaignAbuseReports怎么用?PHP MCAPI::campaignAbuseReports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCAPI
的用法示例。
在下文中一共展示了MCAPI::campaignAbuseReports方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MCAPI
<?php
/**
This Example shows how to add grab a full set of Campaign Abuse Reports wtih
some basic error checking.
**/
require_once '../mcapi.php';
require_once 'config/config.inc.php';
//contains apikey
// Connect to the MailChimp api with an API Key
$api = new MCAPI($apikey);
$reports = $api->campaignAbuseReports($campaignId);
if ($api->errorCode) {
echo "Unable to run campaignAbuseReports()!\n";
echo "\tCode=" . $api->errorCode . "\n";
echo "\tMsg=" . $api->errorMessage . "\n";
} else {
echo "Total reports:" . $reports['total'] . "\n";
echo "Reports returned:" . sizeof($reports['data']) . "\n";
foreach ($reports['data'] as $rpt) {
echo $rpt['date'] . " - " . $rpt['email'] . " - " . $rpt['type'] . "\n";
}
}