createHiddenGroup(); $mailing = civicrm_api3('Mailing', 'create', [ 'name' => "", 'campaign_id' => NULL, 'replyto_email' => "", 'template_type' => $templateTypes[0]['name'], 'template_options' => ['nonce' => 1], 'subject' => "", 'body_html' => "", 'body_text' => "", 'groups' => [ 'include' => [$groupId], 'exclude' => [], 'base' => [], ], 'mailings' => [ 'include' => [], 'exclude' => [], ], ]); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/mailing/' . $mailing['id'])); } }