$job->mailing_id = $ids['mailing_id'];
$job->delete();
}
+ else {
+ $mailing = new CRM_Mailing_BAO_Mailing();
+ $mailing->id = $ids['mailing_id'];
+ $mailing->find(TRUE);
+
+ $params['scheduled_date'] = CRM_Utils_Date::processDate($mailing->scheduled_date);
+ }
CRM_Mailing_BAO_Mailing::create($params, $ids);
}
else {
// reset them in case this mailing was rejected
+ $mailing = new CRM_Mailing_BAO_Mailing();
+ $mailing->id = $ids['mailing_id'];
+ $mailing->find(TRUE);
+
$mailing->approver_id = 'null';
$mailing->approval_date = 'null';
$mailing->approval_status_id = 'null';
}
- if ($params['now']) {
- $params['scheduled_date'] = date('YmdHis');
- }
- else {
- $params['scheduled_date'] = CRM_Utils_Date::processDate($params['start_date'] . ' ' . $params['start_date_time']);
- }
-
/* Build the mailing object */
CRM_Mailing_BAO_Mailing::create($params, $ids);