1 | <?php |
||
5 | class EmailConfig |
||
6 | { |
||
7 | const MANDATORY_ENV_VARIABLES = [ |
||
8 | self::SMTP_HOST, |
||
9 | self::EMAIL_SUBJECT, |
||
10 | self::FROM_EMAIL, |
||
11 | ]; |
||
12 | const SMTP_USER = 'SMTP_USER'; |
||
13 | const SMTP_PASSWORD = 'SMTP_PASSWORD'; |
||
14 | const SMTP_HOST = 'SMTP_HOST'; |
||
15 | const EMAIL_SUBJECT = 'EMAIL_SUBJECT'; |
||
16 | const FROM_EMAIL = 'FROM_EMAIL'; |
||
17 | const FROM_NAME = 'FROM_NAME'; |
||
18 | const TO_EMAILS = 'TO_EMAILS'; |
||
19 | const SERVER_HOST = 'SERVER_HOST'; |
||
20 | |||
21 | /** @var bool */ |
||
22 | private $enabled = true; |
||
23 | |||
24 | /** |
||
25 | * @return $this |
||
26 | */ |
||
27 | public function enable() |
||
33 | |||
34 | /** |
||
35 | * @return $this |
||
36 | */ |
||
37 | public function disable() |
||
43 | |||
44 | /** |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function isEnabled() |
||
51 | |||
52 | public function getSmtpUsername(): string |
||
56 | |||
57 | |||
58 | |||
59 | public function getSmtpPassword(): string |
||
63 | |||
64 | |||
65 | |||
66 | public function getSmtpHost(): string |
||
70 | |||
71 | |||
72 | |||
73 | public function getEmailSubject(): string |
||
77 | |||
78 | |||
79 | |||
80 | public function getFromEmail(): string |
||
84 | |||
85 | |||
86 | |||
87 | public function getFromName(): string |
||
91 | |||
92 | |||
93 | |||
94 | public function getRecipientsList(): array |
||
98 | |||
99 | |||
100 | |||
101 | public function getServerHost(): string |
||
105 | } |
||
106 |