Merge pull request #16935 from eileenmcnaughton/email_common
[civicrm-core.git] / CRM / Contribute / 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 contacts.
20 */
21 class CRM_Contribute_Form_Task_Email extends CRM_Contribute_Form_Task {
22 use CRM_Contact_Form_Task_EmailTrait;
23
24 /**
25 * Build all the data structures needed to build the form.
26 */
27 public function preProcess() {
28 CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
29 parent::preProcess();
30
31 // we have all the contribution ids, so now we get the contact ids
32 parent::setContactIDs();
33
34 $this->assign('single', $this->_single);
35 }
36
37 /**
38 * Build the form object.
39 */
40 public function buildQuickForm() {
41 //enable form element
42 $this->assign('emailTask', TRUE);
43
44 CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this);
45 }
46
47 /**
48 * List available tokens for this form.
49 *
50 * @return array
51 */
52 public function listTokens() {
53 $tokens = CRM_Core_SelectValues::contactTokens();
54 $tokens = array_merge(CRM_Core_SelectValues::contributionTokens(), $tokens);
55 return $tokens;
56 }
57
58 }