Opscale\NotificationCenter\Notifications\SmsNotificationChannel identifier:
smsUnderlying driver:
NotificationChannels\Twilio\TwilioChannel
SmsNotification sends a plain-text SMS to the subscriber’s phone number using the laravel-notification-channels/twilio package.
Requirements
Method signatures
via()
Returns [TwilioChannel::class], routing the notification through the Twilio notification channel.
toTwilio(object $notifiable): TwilioSmsMessage
Builds and returns a NotificationChannels\Twilio\TwilioSmsMessage. The SMS body is composed as:
| Field | Source |
|---|---|
| Content | $delivery->notification->summary followed by a newline and the tracked open URL |
| Tracked URL | Open tracking route for $delivery->open_slug |
What data it sends
The outbound SMS contains:- The notification’s
summarytext - A blank line separator
- The full tracking URL for the delivery’s
open_slug
Usage example
Addsms to a strategy’s channels array:
routeNotificationForTwilio() returning the recipient’s phone number in E.164 format (e.g. +15551234567):
The subscriber’s contact value stored in the subscription record should be the phone number in E.164 format.