Skip to content

Commit a50563b

Browse files
committed
Enable overriding the Twilio message source
1 parent f0128ce commit a50563b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/TwilioChannel.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function send($notifiable, Notification $notification)
4545
{
4646
try {
4747
$to = $this->getTo($notifiable, $notification);
48-
$message = $notification->toTwilio($notifiable);
48+
$message = $this->getMessage($notifiable, $notification);
4949
$useSender = $this->canReceiveAlphanumericSender($notifiable);
5050

5151
if (is_string($message)) {
@@ -75,6 +75,19 @@ public function send($notifiable, Notification $notification)
7575
}
7676
}
7777

78+
/**
79+
* Get the message to send.
80+
*
81+
* @param mixed $notifiable
82+
* @param Notification $notification
83+
*
84+
* @return mixed
85+
*/
86+
protected function getMessage($notifiable, Notification $notification)
87+
{
88+
return $notification->toTwilio($notifiable);
89+
}
90+
7891
/**
7992
* Get the address to send a notification to.
8093
*

0 commit comments

Comments
 (0)