laravel-notification-channels / plivo

Plivo notifications channel for Laravel
https://laravel-notification-channels.com
MIT License
8 stars 19 forks source link

Saving Plivo's HTTP response. #13

Closed cthorne91 closed 8 years ago

cthorne91 commented 8 years ago

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.

koomai commented 8 years ago

👍🏼 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.

cthorne91 commented 8 years ago

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. :pray:

cthorne91 commented 8 years ago

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.