X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FMailingContact.php;h=b1ef759bffc7b93f5d73e92e6f795b54c8e47906;hb=c156d4d6f1d69cfb9e578901f485b67e39f70cf3;hp=a6fa23d0b824bbbe4c7e4d3dcea0ce773dcdbbf7;hpb=941fd0a87b6525cbca7b8332c16c3cd6440947ee;p=civicrm-core.git diff --git a/api/v3/MailingContact.php b/api/v3/MailingContact.php index a6fa23d0b8..b1ef759bff 100644 --- a/api/v3/MailingContact.php +++ b/api/v3/MailingContact.php @@ -1,7 +1,7 @@ 'Delivered', + 'type' => CRM_Utils_Type::T_STRING, + 'options' => array( + 'Delivered' => 'Delivered', + 'Bounced' => 'Bounced', + ) ); } @@ -121,7 +128,7 @@ GROUP BY m.id 'contact_id' => $contactID ); - $results = array('count' => $dao->N); + $results = $dao->N; } else { $defaultFields = array( @@ -182,16 +189,9 @@ LIMIT %2, %3 $results[$dao->mailing_id][$l] = $dao->$l; } } - - $params = array( - 'type' => $type, - 'contact_id' => $contactID, - 'offset' => $offset, - 'limit' => $limit - ); } - return civicrm_api3_create_success($results, $params); + return $results; } function _civicrm_api3_mailing_contact_get_delivered( @@ -264,11 +264,5 @@ INNER JOIN civicrm_mailing_event_bounce meb ON meb.event_queue_id = meq.id * */ function civicrm_api3_mailing_contact_getcount($params) { - if (empty($params['contact_id'])) { - return civicrm_api3_create_error('contact_id is a required field'); - } - - // set the count mode for the api - $params['getcount'] = 1; - return civicrm_api3_mailing_contact_get($params); + return _civicrm_api3_mailing_contact_getresults($params, TRUE); }