From 88c50f467686c8f7bb9f0815e9aabe390512a965 Mon Sep 17 00:00:00 2001 From: Siddhant Rajagopalan Date: Sun, 17 Aug 2014 15:09:34 +0530 Subject: [PATCH] send test and send mail working --- CRM/Mailing/Event/BAO/Delivered.php | 4 ++-- api/v3/Mailing.php | 4 +--- js/angular-newMailing.js | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Mailing/Event/BAO/Delivered.php b/CRM/Mailing/Event/BAO/Delivered.php index 2bfac17eba..45a773a3b4 100644 --- a/CRM/Mailing/Event/BAO/Delivered.php +++ b/CRM/Mailing/Event/BAO/Delivered.php @@ -149,7 +149,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { * @static */ public static function &getRows($mailing_id, $job_id = NULL, - $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL + $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $is_test = FALSE ) { $dao = new CRM_Core_Dao(); @@ -178,7 +178,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { ON $bounce.event_queue_id = $queue.id INNER JOIN $job ON $queue.job_id = $job.id - AND $job.is_test = 0 + AND $job.is_test = $is_test INNER JOIN $mailing ON $job.mailing_id = $mailing.id WHERE $bounce.id IS null diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index e0631f6fed..261e45f9e5 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -347,7 +347,6 @@ function civicrm_api3_mailing_send_test($params) { $testEmailParams = _civicrm_api3_generic_replace_base_params($params); $testEmailParams['is_test'] = 1; $job = civicrm_api3('MailingJob', 'create', $testEmailParams); - print_r($job); $testEmailParams['job_id'] = $job['id']; $testEmailParams['emails'] = explode(',', $testEmailParams['test_email']); if (!empty($params['test_email'])) { @@ -406,8 +405,7 @@ ORDER BY e.is_bulkmail DESC, e.is_primary DESC } //return delivered mail info - $mailDelivered = CRM_Mailing_Event_BAO_Delivered::getRows($params['mailing_id'], $job['id'], TRUE, NULL, NULL, NULL); - print_r($mailDelivered); + $mailDelivered = CRM_Mailing_Event_BAO_Delivered::getRows($params['mailing_id'], $job['id'], TRUE, NULL, NULL, NULL, TRUE); return civicrm_api3_create_success($mailDelivered); } diff --git a/js/angular-newMailing.js b/js/angular-newMailing.js index ef6c7b9713..827e941dec 100644 --- a/js/angular-newMailing.js +++ b/js/angular-newMailing.js @@ -612,7 +612,6 @@ resulta.success(function(data) { console.log("worked"); }); - console.log("didnt work"); }; }); -- 2.25.1