From 880b53e76dc797dbbfb36381d20a5364ecff598d Mon Sep 17 00:00:00 2001 From: wdog Date: Thu, 20 Apr 2017 13:06:14 +0200 Subject: [PATCH] Send Notification to multiple email --- config/server-monitor.php | 5 ++++- src/Notifications/Senders/Mail.php | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/server-monitor.php b/config/server-monitor.php index 0623961..8669698 100644 --- a/config/server-monitor.php +++ b/config/server-monitor.php @@ -85,7 +85,10 @@ */ 'mail' => [ 'from' => 'your@email.com', - 'to' => 'your@email.com', + 'to' => [ + 'your@email.com', + 'another@email.com' + ] ], /* diff --git a/src/Notifications/Senders/Mail.php b/src/Notifications/Senders/Mail.php index e16b906..cc61d53 100644 --- a/src/Notifications/Senders/Mail.php +++ b/src/Notifications/Senders/Mail.php @@ -29,11 +29,12 @@ public function __construct(Mailer $mailer, Repository $config) public function send() { $this->mailer->raw($this->message, function (Message $message) { - + foreach ($this->config['to'] as $mailTo) { $message - ->subject($this->subject) - ->from($this->config['from']) - ->to($this->config['to']); + ->subject($this->subject) + ->from($this->config['from']) + ->to($mailTo); + } }); } }