4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
13 namespace Civi\WorkflowMessage
;
15 use Civi\Schema\Traits\MagicGetterSetterTrait
;
16 use Civi\WorkflowMessage\Traits\FinalHelperTrait
;
17 use Civi\WorkflowMessage\Traits\ReflectiveWorkflowTrait
;
20 * Generic base-class for describing the inputs for a workflow email template.
22 * @method $this setContactId(int|null $contactId)
23 * @method int|null getContactId()
25 class GenericWorkflowMessage
implements WorkflowMessageInterface
{
27 // Implement getFields(), import(), export(), validate() - All methods based on inspecting class properties (`ReflectionClass`).
28 // Define stub methods exportExtraTokenContext(), exportExtraTplParams(), etc.
29 use ReflectiveWorkflowTrait
;
31 // Implement __call() - Public and protected properties are automatically given a default getter/setter. These may be overridden/customized.
32 use MagicGetterSetterTrait
;
34 // Implement assertValid(), renderTemplate(), sendTemplate() - Sugary stub methods that delegate to real APIs.
38 * WorkflowMessage constructor.
40 * @param array $imports
41 * List of values to import.
42 * Ex: ['tplParams' => [...tplValues...], 'tokenContext' => [...tokenData...]]
43 * Ex: ['modelProps' => [...classProperties...]]
45 public function __construct(array $imports = []) {
46 WorkflowMessage
::importAll($this, $imports);
50 * The contact receiving this message.