africastalking-php
africastalking-php copied to clipboard
Sending Batch Messages
How do we achieve batch sending in cases where there is a unique phone number/message combination?
Something like this:
$sms->send([
[
'to' => '0722123456',
'message' => 'This is a unique message'
],
[
'to' => '0713678900',
'message' => 'this is another unique message'
],
[
'to' => '0712345678',
'message' => 'even another one'
],
]);
What is available is sending a similar message to an array of numbers, or maybe am missing something ...
I've also hit this issue as $sms->send([...])
is blocking and sending one SMS after another is unacceptable (as it takes close to 1 second).
I've settled for forking the project to implement asynchronous calling of the API, I'll be raising a PR here in a few.
@codingedward did you manage to implement the asynchronous feature
In fact, I was able to achieve this by changing this part of the doSend
function:
https://github.com/codingedward/africastalking-php/blob/de5d551477b5a279eb5efb0f7dba8b9e0d42380b/src/SMS.php#L54-L56