Skip to content

Commit 7b862f5

Browse files
committed
update readme with similar packages
1 parent 96af600 commit 7b862f5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,7 @@ composer test
187187

188188
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
189189

190+
## Similar Packages
191+
192+
- [mail-tracker](https://github.com/jdavidbakr/mail-tracker) - A Laravel package that injects tracking code into outgoing emails and provides an interface to view sent emails, track opens, and monitor link clicks.
193+

src/Listeners/AfterSendingListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function handle(NotificationSent $event): void
1919
->notificationSubscriptions()
2020
->where('notification_template_id', $notification::getTemplate()->id);
2121

22-
// If this notification is for a specific model, include it in the query
23-
if (property_exists($notification, 'customModel') && $notification->customModel) {
22+
// If this notification is using a custom model, include it in the query
23+
if ($notification->customModel) {
2424
$query->where('notifiable_type', get_class($notification->customModel))
2525
->where('notifiable_id', $notification->customModel->id);
2626
}

src/Listeners/BeforeSendingListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function handle(NotificationSending $event): bool
3636
}
3737

3838
// Always create/update subscription for this specific notification
39-
if (property_exists($notification, 'customModel') && $notification->customModel) {
39+
if ($notification->customModel) {
4040
$event->notifiable->subscribeToNotification($template, $notification->customModel);
4141
} else {
4242
$event->notifiable->subscribeToNotification($template);
@@ -46,8 +46,8 @@ public function handle(NotificationSending $event): bool
4646
$query = $event->notifiable->notificationSubscriptions()
4747
->where('notification_template_id', $template->id);
4848

49-
// If this notification is for a specific model, include it in the query
50-
if (property_exists($notification, 'customModel') && $notification->customModel) {
49+
// If this notification is using a custom model, include it in the query
50+
if ($notification->customModel) {
5151
$query->where('notifiable_type', get_class($notification->customModel))
5252
->where('notifiable_id', $notification->customModel->id);
5353
}

0 commit comments

Comments
 (0)