From: tschuettler Date: Mon, 26 Sep 2016 15:49:46 +0000 (+0200) Subject: CRM-19413 - CiviMail: Test mail notice errors: undefined index X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a49b32a6bee9e5fa62f89e68cdd220a6f548d64d;p=civicrm-core.git CRM-19413 - CiviMail: Test mail notice errors: undefined index --- diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index 0a418e9a72..8ada60546b 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -588,9 +588,11 @@ function civicrm_api3_mailing_send_test($params) { $testEmailParams = _civicrm_api3_generic_replace_base_params($params); $testEmailParams['is_test'] = 1; + $testEmailParams['status'] = 'Scheduled'; + $testEmailParams['scheduled_date'] = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s')); $job = civicrm_api3('MailingJob', 'create', $testEmailParams); $testEmailParams['job_id'] = $job['id']; - $testEmailParams['emails'] = explode(',', $testEmailParams['test_email']); + $testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', $testEmailParams['test_email']) : NULL; if (!empty($params['test_email'])) { $query = CRM_Utils_SQL_Select::from('civicrm_email e') ->select(array('e.id', 'e.contact_id', 'e.email'))