Add in-app notifications for domain expiration alerts
Implemented logic to create in-app (bell icon) notifications for users when domains are expiring or have expired. The notification recipients are determined by the user isolation mode: in isolated mode, only the domain owner (or group owner) is notified; in shared mode, all active users receive the notification. This applies to both the main check and the retry queue.
This commit is contained in:
@@ -153,12 +153,15 @@ class Notification extends Model
|
||||
*/
|
||||
public function createNotification(int $userId, string $type, string $title, string $message, ?int $domainId = null): int
|
||||
{
|
||||
// Use PHP's current time (respects timezone setting) instead of database's CURRENT_TIMESTAMP
|
||||
// This ensures timezone consistency between cron job and web interface
|
||||
return $this->create([
|
||||
'user_id' => $userId,
|
||||
'type' => $type,
|
||||
'title' => $title,
|
||||
'message' => $message,
|
||||
'domain_id' => $domainId
|
||||
'domain_id' => $domainId,
|
||||
'created_at' => date('Y-m-d H:i:s') // Use PHP timezone, not database timezone
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user