laravel-notification-channels / twilio

Twilio notifications channel for Laravel

Home Page:https://laravel-notification-channels.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Message does not send out on Laravel 5.6.33

setkyar opened this issue · comments

I am using "laravel-notification-channels/twilio": "^2.0", and follow like the readme. But, the message does not sendout and does not appear any errors.

Same issue with me.
Its throwing exception.
CouldNotSendNotification::invalidReceiver();

The notifiable did not have a receiving phone number. Add a routeNotificationForTwilio method or a phone_number attribute to your notifiable.

check if your phone number attribute is set to "phone_number"
if its due to phone number attribute, that you have different column name for phone then you can add below method in User Model
public function routeNotificationForTwilio() { return $this->phone; }

I am having the same issue. This seems to be going through silently too. routeNotificationForTwilio is set in my app

same issue. No logs and no exceptions. Laravel 5.6

Same here! No logs, no exceptions, no message and/or call in Laravel 5.7

Found some clues to this. I modified the TwilioChannel.php exception catch to dd the exception, and I found that the following exception was being thrown.

image

This is with php version 7.2.10

Fixed it in my app. For me this was caused by an update from php 7.1 to 7.2 where I did not think to install the curl extension, and this exception was for whatever reason not being logged. Maybe there is an error in the logging of the exception in the TwillioChannel class? Not quite sure, but if you are having an issue try dumping the exception from that class.

@bryce13950 Yes, as it turned out you just need to catch the exceptions this class through to know what's going on!

@bryce13950 Yes, as it turned out you just need to catch the exceptions this class through to know what's going on!

Do you work on the plugin? I think the best thing to do would be to log this exception in order to help people debug issues.

not working on L5.7.*, no errors and no exceptions. It quietly goes death. No logs on Twilio

Dump the $exception in TwilioChannel.php on line 60 and you'll see the error that Twilio generates (also works in L5.7).

for some reasons, it miraculously work now. No ideas.

So the issue can be closed?

commented

@fwartner is there a way to catch the exception outside the core logic ?
i tried

  if ($exception instanceof NotificationChannels\Twilio\Exceptions\CouldNotSendNotification) {
            dd($exception);
        }

but no luck.

@fwartner is there a way to catch the exception outside the core logic ?
i tried

  if ($exception instanceof NotificationChannels\Twilio\Exceptions\CouldNotSendNotification) {
            dd($exception);
        }

but no luck.

I could be wrong, but I remember looking into this, and finding that there was a general catch wrapping all functionality that prevents library level exceptions from propagating.

commented

@bryce13950 this is just sad, believe it or not i spent 2 days trying to figure where the damn problem is until i stumbled across this

Had same issue and able to fix it by installing php7.2-curl on server.