Skip to content

Commit 64d797d

Browse files
committed
Index "key" was wrong should be "field"
1 parent ddd21fc commit 64d797d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/OneSignalChannel.php

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

3535
$payload = $notification->toOneSignal($notifiable)->toArray();
3636
if (is_array($userIds) && array_key_exists('email', $userIds)) {
37-
$payload['filters'] = collect(["key" => "email", "relation" => "=", "value" => $userIds['email']]);
37+
$payload['filters'] = collect(["field" => "email", "relation" => "=", "value" => $userIds['email']]);
3838
} else {
3939
$payload['include_player_ids'] = collect($userIds);
4040
}

tests/ChannelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function it_can_send_a_notification_with_email()
9898
'chrome_icon' => 'Icon',
9999
'adm_small_icon' => 'Icon',
100100
'small_icon' => 'Icon',
101-
'filters' => collect(["key" => "email", "relation" => "=", "value" => '[email protected]']),
101+
'filters' => collect(["field" => "email", "relation" => "=", "value" => '[email protected]']),
102102
])
103103
->andReturn($response);
104104

0 commit comments

Comments
 (0)