laravel-notification-channels / plivo

Plivo notifications channel for Laravel

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saving Plivo's HTTP response.

cthorne91 opened this issue · comments

Thanks for this repo!

I am thinking about upgrading my current custom plivo sms code in my Larvel app with this repo and Laravel 5.3 notifications. However one thing I currently do is record message ids that are returned by plivo's HTTP responses.

Can you think of a way to get the response out to a layer I can interact with it?

I was thinking about this:

  1. In PlivoChannel.php around line 56 save the $response to a public property.
  2. Using notification events https://laravel.com/docs/5.3/notifications#notification-events
    I could access $event->channel->response;

Not sure if there are problems with this thought process I'm not seeing.
Thanks for your thoughts.

commented

👍🏼 I can have a go when I get the chance. Alternatively, you can try it out and create a pull request if it works for you.

I would love the opportunity to contribute. I'm thinking I won't have time to work on this for a few days. I'll try to make a pull request within a week or so. 🙏

Turns out the channel property is a string not the actually channel object. Saving a property on the channel wasn't the right solution. However, the NotificationSent event already has a response property. Pull request #14 adds support for this.