X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FMailing.php;h=a71e5645d96f8ba969693eeecd8be2a227d24634;hb=d9103d1b67e4eae62e5d913c3bd0926688b31ff1;hp=aec00c43d0cd076583867ea5f1645d554d42c9ec;hpb=f6d6e219a83dca583b9c763c8c7df2a2049dd71d;p=civicrm-core.git diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index aec00c43d0..a71e5645d9 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -594,7 +594,7 @@ function civicrm_api3_mailing_preview($params) { return civicrm_api3_create_success([ 'id' => $mailingID, 'contact_id' => $contactID, - 'subject' => $mime->headers()['Subject'], + 'subject' => CRM_Utils_Array::value('Subject', $mime->headers(), ''), 'body_html' => $mime->getHTMLBody(), 'body_text' => $mime->getTXTBody(), ]); @@ -639,7 +639,9 @@ function civicrm_api3_mailing_send_test($params) { $testEmailParams['is_test'] = 1; $testEmailParams['status'] = 'Scheduled'; $testEmailParams['scheduled_date'] = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s')); + $testEmailParams['is_calling_function_updated_to_reflect_deprecation'] = TRUE; $job = civicrm_api3('MailingJob', 'create', $testEmailParams); + CRM_Mailing_BAO_Mailing::getRecipients($testEmailParams['mailing_id']); $testEmailParams['job_id'] = $job['id']; $testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', strtolower($testEmailParams['test_email'])) : NULL; if (!empty($params['test_email'])) {