1 | <?php |
||
8 | class Twilio |
||
9 | { |
||
10 | /** |
||
11 | * @var TwilioService |
||
12 | */ |
||
13 | protected $twilioService; |
||
14 | |||
15 | /** |
||
16 | * Default 'from' from config. |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $from; |
||
20 | |||
21 | /** |
||
22 | * Twilio constructor. |
||
23 | * |
||
24 | * @param TwilioService $twilioService |
||
25 | * @param string $from |
||
26 | */ |
||
27 | public function __construct(TwilioService $twilioService, $from) |
||
32 | |||
33 | /** |
||
34 | * Send a TwilioMessage to the a phone number. |
||
35 | * |
||
36 | * @param TwilioMessage $message |
||
37 | * @param $to |
||
38 | * @return mixed |
||
39 | * @throws CouldNotSendNotification |
||
40 | */ |
||
41 | public function sendMessage(TwilioMessage $message, $to) |
||
53 | |||
54 | protected function sendSmsMessage($message, $to) |
||
62 | |||
63 | protected function makeCall($message, $to) |
||
71 | |||
72 | protected function getFrom($message) |
||
80 | } |
||
81 |