Skip to content

Commit

Permalink
Merge pull request #14097 from eileenmcnaughton/mailin_test
Browse files Browse the repository at this point in the history
Deprecate creating recipients from MailingJob.create.
  • Loading branch information
mattwire authored Jun 1, 2019
2 parents 596ebcc + 2dd8a2c commit 15879bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Mailing/BAO/MailingJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function create($params) {
$jobDAO = new CRM_Mailing_BAO_MailingJob();
$jobDAO->copyValues($params, TRUE);
$jobDAO->save();
if (!empty($params['mailing_id'])) {
if (!empty($params['mailing_id']) && empty('is_calling_function_updated_to_reflect_deprecation')) {
CRM_Mailing_BAO_Mailing::getRecipients($params['mailing_id']);
}
CRM_Utils_Hook::post($op, 'MailingJob', $jobDAO->id, $jobDAO);
Expand Down
2 changes: 2 additions & 0 deletions api/v3/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down

0 comments on commit 15879bf

Please sign in to comment.