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

Serialization of 'Closure' is not allowed when NotificationFailed event is fired

vedmant opened this issue · comments

I added NotificationFailed listener that implements ShouldQueue to log twilio errors and do some other things, but TwillioChannel is trying to send whole $exception, which causes this error on this line:

        $event = new NotificationFailed($notifiable, $notification, 'twilio', ['message' => $exception->getMessage(), 'exception' => $exception]);

If I remove 'exception' => $exception it works fine.

Twilio error I tried is: "[HTTP 400] Unable to create record: The 'To' number is not a valid phone number."

I use Laravel 5.4

Looks like you have something wrong on your config.