fixed notification system and added a new tenant notifications receipt table to track read status and filter messages by scope.
This commit is contained in:
@@ -43,12 +43,24 @@ class SendEventPackagePhotoLimitNotification implements ShouldQueue
|
||||
return;
|
||||
}
|
||||
|
||||
$context = $this->context($eventPackage);
|
||||
|
||||
if ($this->isDuplicateNotification($tenant, 'photo_limit', $context, ['event_package_id', 'limit'])) {
|
||||
$this->logNotification($tenant, [
|
||||
'type' => 'photo_limit',
|
||||
'status' => 'skipped',
|
||||
'context' => array_merge($context, ['reason' => 'duplicate']),
|
||||
]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$preferences = app(\App\Services\Packages\TenantNotificationPreferences::class);
|
||||
if (! $preferences->shouldNotify($tenant, 'photo_limits')) {
|
||||
$this->logNotification($tenant, [
|
||||
'type' => 'photo_limit',
|
||||
'status' => 'skipped',
|
||||
'context' => $this->context($eventPackage),
|
||||
'context' => $context,
|
||||
]);
|
||||
|
||||
return;
|
||||
@@ -69,14 +81,12 @@ class SendEventPackagePhotoLimitNotification implements ShouldQueue
|
||||
$this->logNotification($tenant, [
|
||||
'type' => 'photo_limit',
|
||||
'status' => 'skipped',
|
||||
'context' => array_merge($this->context($eventPackage), ['reason' => 'no_recipient']),
|
||||
'context' => array_merge($context, ['reason' => 'no_recipient']),
|
||||
]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$context = $this->context($eventPackage);
|
||||
|
||||
$this->dispatchToRecipients(
|
||||
$tenant,
|
||||
$emails,
|
||||
|
||||
Reference in New Issue
Block a user