Opscale\NotificationCenter\Notifications\EmailNotificationChannel identifier:
emailUnderlying driver:
Illuminate\Notifications\Channels\MailChannel
EmailNotification delivers a notification via Laravel’s built-in mail channel. It builds a MailMessage directly from the delivery’s notification content and routes it through whatever mail driver is configured in your Laravel application.
Method signatures
via()
Returns [MailChannel::class], routing the notification through Illuminate\Notifications\Channels\MailChannel.
toMail(object $notifiable): MailMessage
Builds and returns the Illuminate\Notifications\Messages\MailMessage. The message is composed as follows:
| Field | Source |
|---|---|
| Subject | $delivery->notification->subject |
| Greeting | "Hello {$notifiable->name}" (translated prefix) |
| Body line | $delivery->notification->summary if set, otherwise $delivery->notification->body |
| Action button | ”View” linking to the tracked open route (only included when open_slug is set) |
Mailable classes
The package also ships two standalone mailables used for other purposes:RenderTemplate
Class: Opscale\NotificationCenter\Mailables\RenderTemplate
$notification->subject. The content view is notification-center::notifications.mail.
SubscribeTemplate
Class: Opscale\NotificationCenter\Mailables\SubscribeTemplate
"Subscribe to Push Notifications" (translated). The content view is notification-center::webpush.subscribe.
URL the browser calls to register the push subscription.
URL to the service worker script that handles push events.
VAPID public key used when subscribing the browser to push notifications.
Usage example
Theemail channel is the sole channel in the marketing strategy and is also included in system:
routeNotificationForMail() or have a email attribute for Laravel’s mail channel to resolve the recipient address.
Email delivery respects the
days and hours windows defined in the strategy config. Marketing emails are restricted to weekdays between 09:00 and 18:00 by default.