(dev/mail/5) "New Mailing" - Previews should not schedule real blasts
authorTim Otten <totten@civicrm.org>
Fri, 30 Mar 2018 22:02:42 +0000 (15:02 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 30 Mar 2018 22:11:13 +0000 (15:11 -0700)
commit80955669a211795d6838d9ff38ca77668672b06f
tree4f9bafcc414929476ca555128bf38f8059932adf
parenteda4db78a8f33b74d68346079f7e7777140700df
(dev/mail/5) "New Mailing" - Previews should not schedule real blasts

In `CRM_Mailing_BAO_Mailing::create` and `Mailing.create` API, there is a
(*ahem*) special behavior where setting the `scheduled_date` will
immediately trigger scheduling.  One shouldn't submit `scheduled_date` for a
preview.

This was not symptomatic before #11142/v4.7.31 because all preview
operations were wrapped in a transaction and rolled back.  But now previews
are allowed to have side-effects, so we need some other means to prevent.

This copies the workaround from `crmMailingMgr.save()` and applies
it to `crmMailingMgr.preview()` (etal).
ang/crmMailing/services.js