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.notificationkontrolüdefaultChannel = NotificationChannel::DB- Her notification DB + defaultChannel kanallarına gider
setChannels()— Kanalları özelleştirme
NewLeadNotification
defaultChannel = MOBILE_PUSHisPromotional = false(lead bildirimi promosyon değil)toMobilePush()→ OneSignalMessageShouldQueue→ 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
Related
- api-key-integrations — OneSignal + Infobip
- api-lead-flow — Lead bildirimleri
- api-user-model-methods — routeNotificationForOneSignal