Skip to content

Commit

Permalink
Fix SMS bulk enqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
aksalj committed Mar 8, 2018
1 parent c1ea37d commit 8841bdb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 179 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ The SDK needs to be instantiated using your username and API key, which you can
```php
<?php

use AfricasTalking;
use AfricasTalking\SDK\AfricasTalking;

$username = 'YOUR_USERNAME'; // use 'sandbox' for development in the test environment
$apiKey = 'YOUR_API_KEY'; // use your sandbox app API key for development in the test environment
$AT = new AfricasTalking($username, $apiKey);

```
You can now use the API to make calls using the $AT object we have just initiated. See [example](example/) for more usage examples.
You can now make API calls using the `$AT` object we have just created. See [example](example/) for more usage examples.

### Airtime

Expand Down Expand Up @@ -62,10 +62,12 @@ $SMS->send($options);
```

The options array `$options` has the following keys:

- `message`: SMS content. `REQUIRED`
- `to`: A single recipient or an array of recipients. `REQUIRED`
- array of recipients contains
- `from`: Shortcode or alphanumeric ID that is registered with Africa's Talking account.
- `message`: SMS content. `REQUIRED`
- `enqueue`: Do not wait for an acknowledgement form telcos.

#### Send Premium SMS

Expand Down
2 changes: 1 addition & 1 deletion example/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Simple SDK usage",
"require": {
"php": ">=5.3.0",
"africastalking/africastalking": "2.0.0",
"africastalking/africastalking": "2.0.1",
"altorouter/altorouter": "1.1.0"
}
}
31 changes: 8 additions & 23 deletions example/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/SMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ protected function doSend ($options, $isBulk, $isPremium)
];

if ($isBulk === true){
$data['bulkSMSMode'] = 1;
}

if (array_key_exists('enqueue', $options) && $options['enqueue']) {
$data['enqueue'] = 1;
}

Expand Down
152 changes: 0 additions & 152 deletions tests/Fixtures.php

This file was deleted.

0 comments on commit 8841bdb

Please sign in to comment.