1 | <?php |
||
22 | abstract class AbstractEmailByKey extends BaseJob |
||
23 | { |
||
24 | /** |
||
25 | * The email key |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public abstract function getKey(): string; |
||
30 | |||
31 | /** |
||
32 | * The recipients |
||
33 | * |
||
34 | * @return User[] |
||
35 | */ |
||
36 | public abstract function getRecipients(): array; |
||
37 | |||
38 | /** |
||
39 | * The email params |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | public abstract function getParams(): array; |
||
44 | |||
45 | /** |
||
46 | * Returns a default description for [[getDescription()]]. |
||
47 | * |
||
48 | * @return string|null |
||
49 | */ |
||
50 | protected function defaultDescription() |
||
54 | |||
55 | /** |
||
56 | * @param \craft\queue\QueueInterface|\yii\queue\Queue $queue |
||
57 | * @throws \Exception |
||
58 | */ |
||
59 | public function execute($queue) |
||
117 | |||
118 | /** |
||
119 | * @param $recipient |
||
120 | * @param array $params |
||
121 | * @return MessageInterface |
||
122 | * @throws \yii\base\InvalidConfigException |
||
123 | */ |
||
124 | protected function composeMessage($recipient, array $params): MessageInterface |
||
135 | } |
||
136 |