Skip to content

Commit 2e38986

Browse files
authored
add $notification as param to routeNotificationFor (#20)
* feat: add $notification as param to $notifiable->routeNotificationFor * test: add $notification to test case
1 parent 48cee97 commit 2e38986

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SendGridChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function send($notifiable, Notification $notification)
4646
}
4747

4848
if (empty($message->tos)) {
49-
$to = $notifiable->routeNotificationFor('mail');
49+
$to = $notifiable->routeNotificationFor('mail', $notification);
5050

5151
// Handle the case where routeNotificationForMail returns an array (email => name)
5252
if (is_array($to)) {

tests/SendGridChannelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function toSendGrid($notifiable)
109109
$notifiable = new class {
110110
use Notifiable;
111111

112-
public function routeNotificationForMail()
112+
public function routeNotificationForMail($notification)
113113
{
114114
return 'john@example.com';
115115
}
@@ -124,7 +124,7 @@ public function routeNotificationForMail()
124124
$notifiableWithEmailAndName = new class {
125125
use Notifiable;
126126

127-
public function routeNotificationForMail()
127+
public function routeNotificationForMail($notification)
128128
{
129129
return [
130130
'john@example.com' => 'John Doe',

0 commit comments

Comments
 (0)