tzsk / sms

Laravel SMS Gateway Integration Package
MIT License
289 stars 79 forks source link

add some features to each driver if they support. #209

Closed khanzadimahdi closed 4 years ago

khanzadimahdi commented 4 years ago

Hi, what's your opinion about adding some features to each driver and a feature checking ability to the package? for example, some SMS gateways can send bulk messages and some of them doesn't support bulk messages. I can create the below syntax:

Sms::via('gateway')->whenSupportsBulkMessage(
       function($sms){
            $sms->sendBulk("this message")->to(['Number 1', 'Number 2'])->dispatch();
       }
)->whenDoesntSupportBulkMessage(function($sms) {
       function($sms){
            $sms->send("this message")->to(['Number 1', 'Number 2'])->dispatch();
       }
})

or something like the below syntax:

// check if given gateway supports bulk sending messages.
if (Sms::via('gateway')->supportsBulkMessage()) { 
       //
}

if I add this feature, would you merge it ?

tzsk commented 4 years ago

@khanzadimahdi Do we need different ways for each of them?

Can we not just bulk send them when recipient count is more than one?

khanzadimahdi commented 4 years ago

bulk send is an example! as you know sms gateways offer more features. for example time-base messages or one-time read (flash) messages! or even sound messages! receiving messages!

I use Kavehnegar gateway , and it offers sms templates! sms template is a prepared message (like prepared sql query) and data can be passed only to it to be sent to recipients.

I want to add some interfaces for these features and also an ability to check if a feature exists in selected gateway or not.

would you merge it if i add these functionalities? hmm, or i would fork and develop and improved version of this package in my repositories if you don't like these features!

khanzadimahdi commented 4 years ago

i close this issue and develop suggested features in another package because of your late answering.