1 | <?php |
||
27 | class Email |
||
28 | { |
||
29 | |||
30 | const DEFAULT_MSG_TPL = 'Core.message'; |
||
31 | |||
32 | /** |
||
33 | * Entity object. |
||
34 | * |
||
35 | * @var Entity |
||
36 | */ |
||
37 | protected $_data; |
||
38 | |||
39 | /** |
||
40 | * Message template. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $_tpl; |
||
45 | |||
46 | /** |
||
47 | * Server name from env(). |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $_serverName; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $_fromName = 'CMS'; |
||
57 | |||
58 | /** |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $_fromEmail = '[email protected]'; |
||
62 | |||
63 | /** |
||
64 | * @var string |
||
65 | */ |
||
66 | protected $_format = 'html'; |
||
67 | |||
68 | /** |
||
69 | * Mail constructor. |
||
70 | * |
||
71 | * @param Entity|array $data |
||
72 | * @param string $tpl |
||
73 | */ |
||
74 | public function __construct($data = [], $tpl = self::DEFAULT_MSG_TPL) |
||
84 | |||
85 | /** |
||
86 | * Send message method. |
||
87 | * |
||
88 | * @param string $subject |
||
89 | * @param string $content |
||
90 | * @param string|array $to |
||
91 | * @param string $fromName |
||
92 | * @param string $fromEmail |
||
93 | * @return array |
||
94 | */ |
||
95 | public function send($subject, $content, $to, $fromName = '', $fromEmail = '') |
||
113 | |||
114 | /** |
||
115 | * Constructor hook method. |
||
116 | * |
||
117 | * @return void |
||
118 | */ |
||
119 | protected function _initialize() |
||
123 | } |
||
124 |