Example #1
0
 /**
  * Returns all bounces
  *
  * @param int $id The id of the campaign.
  * @return array
  */
 public static function getBounces($id)
 {
     $cmId = self::getCampaignMonitorID('campaign', $id);
     $bounces = self::getCM()->getCampaignBounces($cmId);
     $addresses = BackendMailmotorModel::getAddressesAsPairs();
     if (empty($bounces)) {
         return array();
     }
     // loop the bounces, check what bounces are still in our database
     foreach ($bounces as $key => $bounce) {
         // check if the bounced address is in the full list of addresses
         if (!in_array($bounce['email'], $addresses)) {
             unset($bounces[$key]);
         }
     }
     return (array) $bounces;
 }