Skip to content

Commit

Permalink
Change the way we build $message->to - use a foreach to add each reci…
Browse files Browse the repository at this point in the history
…pient.
  • Loading branch information
ArronKing committed May 21, 2024
1 parent adea0c6 commit 9c6adf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SendGridChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public function send($notifiable, Notification $notification)

// Handle the case where routeNotificationForMail returns an array (email => name)
if (is_array($to)) {
reset($to);
$message->to(key($to), current($to));
foreach ($to as $email => $name) {
$message->to($email, $name);
}
} else {
$message->to($to);
}
Expand Down

0 comments on commit 9c6adf6

Please sign in to comment.