1 | <?php declare(strict_types=1); |
||
16 | abstract class AbstractEmailNotification extends AbstractJob |
||
17 | { |
||
18 | /** |
||
19 | * The sender email address and name as an array. |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $origin = [ |
||
23 | '[email protected]' => 'No Reply' |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * The email subject. This should be explicitly declared in extensions |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $subject; |
||
31 | |||
32 | /** |
||
33 | * The name of the viewfile to use within @app/views/email/(html|text) |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $viewFile; |
||
37 | |||
38 | abstract protected function getSubject(); |
||
39 | |||
40 | /** |
||
41 | * Generates a message composition and returns a MessageInterface |
||
42 | * @param string|array $to |
||
43 | * @param array $args |
||
44 | * @return yii\mail\MessageInterface |
||
45 | */ |
||
46 | protected function compose($to, array $args = []) : MessageInterface |
||
67 | |||
68 | /** |
||
69 | * Implementation of RPQ\AbstractJob\Perform to send the actual email |
||
70 | * @param array $args |
||
71 | * @return int |
||
72 | */ |
||
73 | public function perform(array $args = []) : int |
||
83 | } |