Skip to content

Commit

Permalink
Allow passing of recipient name in Mail notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Propaganistas committed Jun 15, 2018
1 parent f05da72 commit e41bee9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Notifications/Channels/MailChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ protected function getRecipients($notifiable, $notification, $message)
$recipients = [$recipients];
}

return collect($recipients)->map(function ($recipient) {
return is_string($recipient) ? $recipient : $recipient->email;
return collect($recipients)->mapWithKeys(function ($recipient, $email) {
if (! is_numeric($email)) {
return [$email => $recipient];
}

return [(is_string($recipient) ? $recipient : $recipient->email)];
})->all();
}

Expand Down

0 comments on commit e41bee9

Please sign in to comment.