Merge pull request #23221 from eileenmcnaughton/mapField
[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 * Only send one email per contact.
27 *
28 * This has historically been done for contributions & makes sense if
29 * no entity specific tokens are in use.
30 *
31 * @return bool
32 * @throws \CRM_Core_Exception
33 */
34 protected function isGroupByContact(): bool {
35 return !empty($this->getMessageTokens()['membership']);
36 }
37
38 }