Skip to content

Commit ddf2ed5

Browse files
authored
Merge pull request #2 from onlime/142-totwilio-override
Enable overriding the Twilio message source
2 parents 0cd8604 + 88f2572 commit ddf2ed5

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
@@ -49,7 +49,7 @@ public function send($notifiable, Notification $notification)
4949

5050
try {
5151
$to = $this->getTo($notifiable, $notification);
52-
$message = $notification->toTwilio($notifiable);
52+
$message = $this->getMessage($notifiable, $notification);
5353
$useSender = $this->canReceiveAlphanumericSender($notifiable);
5454

5555
if (is_string($message)) {
@@ -79,6 +79,19 @@ public function send($notifiable, Notification $notification)
7979
}
8080
}
8181

82+
/**
83+
* Get the message to send.
84+
*
85+
* @param mixed $notifiable
86+
* @param Notification $notification
87+
*
88+
* @return mixed
89+
*/
90+
protected function getMessage($notifiable, Notification $notification)
91+
{
92+
return $notification->toTwilio($notifiable);
93+
}
94+
8295
/**
8396
* Check if twilio is enabled.
8497
*

0 commit comments

Comments
 (0)