1 | <?php |
||
11 | class Mailer |
||
12 | { |
||
13 | /** @var \Swift_Mailer */ |
||
14 | private $swift; |
||
15 | private $from; |
||
16 | |||
17 | private $message; |
||
18 | private $tpl; |
||
19 | |||
20 | /** |
||
21 | * Mailer constructor. Construct object with ref to swiftmailer and sender info |
||
22 | * @param \Swift_Mailer $instance |
||
23 | * @param string $from |
||
24 | */ |
||
25 | public function __construct(\Swift_Mailer $instance, string $from) |
||
30 | |||
31 | /** |
||
32 | * Factory constructor |
||
33 | * @param \Swift_Mailer $instance |
||
34 | * @param string $from |
||
35 | * @return Mailer |
||
36 | */ |
||
37 | public static function factory(\Swift_Mailer $instance, string $from) |
||
41 | |||
42 | /** |
||
43 | * |
||
44 | * @param string $tpl |
||
45 | * @param array|null $params |
||
46 | * @param null|string $dir |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function tpl(string $tpl, ?array $params = [], ?string $dir = null) |
||
56 | |||
57 | public function send(string $to, string $subject, ?string $message = null) |
||
80 | } |