laravel-notification-channels / twilio

Twilio notifications channel for Laravel
https://laravel-notification-channels.com
227 stars 36 forks source link

Fails to send SMS with `messagingServiceSid` #62

Closed SimplyCorey closed 4 years ago

SimplyCorey commented 5 years ago

A message fails to send when using a messagingServiceSid in a notification instead of from

This occurs because of this line: https://github.com/laravel-notification-channels/twilio/blob/master/src/TwilioConfig.php#L69

The getFrom errors as the from is not set within the config object. Instead, the function call should be

    /**
     * Get the default from address.
     *
     * @return string
     */
    public function getFrom()
    {
        if (isset($this->config['from'])) {
            return $this->config['from'];
        }
    }
SimplyCorey commented 5 years ago

As a workaround for now, we have set from to an empty string to force twilio to use the message service sid.

atymic commented 5 years ago

Feel free to PR the fix and i'll check it out.

atymic commented 4 years ago

Resolved in #90