Merge pull request #16700 from christianwach/lab-1635
[civicrm-core.git] / CRM / Member / Form / Task / Email.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * This class provides the functionality to email a group of
20 * contacts.
21 */
22 class CRM_Member_Form_Task_Email extends CRM_Member_Form_Task {
23 use CRM_Contact_Form_Task_EmailTrait;
24
25 /**
26 * Build all the data structures needed to build the form.
27 *
28 * @return void
29 *
30 * @throws \CRM_Core_Exception
31 * @throws \CiviCRM_API3_Exception
32 */
33 public function preProcess() {
34 CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
35 parent::preProcess();
36
37 // we have all the membership ids, so now we get the contact ids
38 parent::setContactIDs();
39
40 $this->assign('single', $this->_single);
41 }
42
43 /**
44 * List available tokens for this form.
45 *
46 * @return array
47 */
48 public function listTokens() {
49 $tokens = CRM_Core_SelectValues::contactTokens();
50 return $tokens;
51 }
52
53 }