Proje: Okul Platform · Hub: Okul Platform — Architecture

Bildirim Kanalları (NotificationChannel)

database     → Laravel DB notifications (in-app)
mobile_push  → OneSignal push notification
mail         → E-posta
sms          → SMS (Infobip)

Bildirim Sınıfı Hiyerarşisi

Notification (abstract, App\Notifications\Notification)
    └── extends Laravel Notification
    ├── NewLeadNotification     (ShouldQueue, HasMobilePush)
    ├── TransferredLeadNotification
    └── NewCommentNotification

Base Notification Özellikleri

  • isPromotional = true → SMS/e-posta’da unsubscribe linki + user_details.notification kontrolü
  • defaultChannel = NotificationChannel::DB
  • Her notification DB + defaultChannel kanallarına gider
  • setChannels() — Kanalları özelleştirme

NewLeadNotification

  • defaultChannel = MOBILE_PUSH
  • isPromotional = false (lead bildirimi promosyon değil)
  • toMobilePush() → OneSignalMessage
  • ShouldQueue → Async

NotificationService (app/Services/Bases/)

NotificationService::sendNewLeadNotification($user, $lead)
NotificationService::sendTransferredLeadNotification($user, $lead)
NotificationService::sendNewCommentNotification($user, $comment)

getUserNotificationList()

B2C kullanıcılar kendi bildirimlerini görebilir:

GET /api/me/notifications
POST /api/me/notifications/mark-as-read

OneSignal Routing

User::routeNotificationForOneSignal():

  • NotificationIdService::getNotificationIdsForUser(userId) → Player ID’ler
  • Tüm cihazlara toplu gönderim