Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public static function get(array $setting): MessengerInterface |
||
32 | { |
||
33 | $apiKey = $setting['config']['api_key'] ?? ''; |
||
34 | $sender = $setting['config']['sender'] ?? ''; |
||
35 | $recipients = $setting['config']['recipients'] ?? []; |
||
36 | |||
37 | $instance = new Sendgrid($apiKey); |
||
38 | $instance->setSubject(__('core', 'messenger_text_mail_subject')); |
||
39 | $instance->addSender($sender); |
||
40 | |||
41 | foreach ($recipients as $recipient) { |
||
42 | $instance->addRecipient($recipient); |
||
43 | } |
||
44 | |||
45 | return $instance; |
||
46 | } |
||
47 | } |