1 | <?php |
||
19 | class MailService implements ServiceInterface |
||
20 | { |
||
21 | protected $viewPath = '@Da/User/resources/views/mail'; |
||
22 | |||
23 | protected $type; |
||
24 | protected $from; |
||
25 | protected $to; |
||
26 | protected $subject; |
||
27 | protected $view; |
||
28 | protected $params = []; |
||
29 | protected $mailer; |
||
30 | |||
31 | /** |
||
32 | * MailService constructor. |
||
33 | * |
||
34 | * @param string $type the mailer type |
||
35 | * @param string $from from email account |
||
36 | * @param string $to to email account |
||
37 | * @param string $subject the email subject |
||
38 | * @param string $view the view to render mail |
||
39 | * @param array $params view parameters |
||
40 | * @param BaseMailer|MailerInterface $mailer mailer interface |
||
41 | */ |
||
42 | 10 | public function __construct($type, $from, $to, $subject, $view, array $params, MailerInterface $mailer) |
|
54 | |||
55 | /** |
||
56 | * @param $name |
||
57 | * @param $value |
||
58 | * |
||
59 | * @return $this |
||
60 | */ |
||
61 | 4 | public function setViewParam($name, $value) |
|
67 | |||
68 | /** |
||
69 | * gets mailer type |
||
70 | * @return string |
||
71 | */ |
||
72 | 9 | public function getType() |
|
76 | |||
77 | /** |
||
78 | * @return bool |
||
79 | */ |
||
80 | 10 | public function run() |
|
89 | } |
||
90 |