3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Given the selected contacts, prepare a mailing with a hidden group.
21 class CRM_Mailing_Form_Task_AdhocMailing
extends CRM_Contact_Form_Task
{
23 public function preProcess() {
25 $templateTypes = CRM_Mailing_BAO_Mailing
::getTemplateTypes();
26 list ($groupId, $ssId) = $this->createHiddenGroup();
27 $mailing = civicrm_api3('Mailing', 'create', [
29 'campaign_id' => NULL,
30 'replyto_email' => "",
31 'template_type' => $templateTypes[0]['name'],
32 'template_options' => ['nonce' => 1],
37 'include' => [$groupId],
47 CRM_Utils_System
::redirect(CRM_Utils_System
::url('civicrm/a/', NULL, TRUE, '/mailing/' . $mailing['id']));