Download the PHP package wearesho-team/turbosms-message-delivery without Composer
On this page you can find all versions of the php package wearesho-team/turbosms-message-delivery. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wearesho-team/turbosms-message-delivery
More information about wearesho-team/turbosms-message-delivery
Files in wearesho-team/turbosms-message-delivery
Package turbosms-message-delivery
Short Description Turbosms message delivery integration
License MIT
Informations about the package turbosms-message-delivery
TurboSMS Integration
wearesho-team/message-delivery implementation of Delivery\ServiceInterface
Installation
Quick Start
-
Install to your Project
- Configure environment
| Variable | Required | Description |
|---|---|---|
| TURBOSMS_HTTP_TOKEN | Yes | HTTP API Token |
| TURBOSMS_SENDER | no | Sender name, that was declared in your account |
| TURBOSMS_VIBER_SENDER | no | Viber-specific sender name (optional) |
- Use in your code
Usage
Configuration
ConfigInterface have to be used to configure requests. Available implementations:
- Config - simple implementation using class properties
- EnvironmentConfig - loads configuration values from environment using getenv
Additional methods
Besides implementing Delivery\ServiceInterface Service provides
- Send sms
Delivery failures
send() returns a Delivery\Result only when TurboSMS issued a message_id. When the recipient is
rejected (blocklist, unsupported country, insufficient balance, duplicate within 90 seconds, …) the API
returns "message_id": null for that recipient, and send() throws a Delivery\Exception carrying the
recipient, the per-recipient status and the overall response status:
The recipient is taken from the phone field of the API response, which is normalised and therefore has
no leading +; it falls back to MessageInterface::getRecipient() when the API omits the field.
getCode() returns the per-recipient response code (406 above) when the API provides one, otherwise the
top-level code. See the status code table for the full list.
Note that a request can succeed overall while an individual recipient fails — TurboSMS reports this as
802/803. A rejected recipient is documented as always carrying message_id: null, so send() throws
for every such response. Should the API ever return a per-recipient error alongside a message_id, the
result is returned with Delivery\Result\Status::Failed and reason() set to the per-recipient status
rather than being reported as Accepted.
batch() does not throw for a rejected recipient, since that would abandon the remaining results. It
yields a Failed result whose messageId() falls back to the internal request key. It does still throw
mid-iteration if an individual request comes back with an empty response_result.
- Check balance on current account
Sender Name Configuration
The library supports different sender names for SMS and Viber channels:
Priority Order (highest to lowest):
- Message-level sender - Set via options, applies to all channels
- Viber-specific sender - Set via config for Viber channel only
- Default sender - Fallback for all channels
Example with Separate Viber Sender:
Environment Configuration:
Authors
- Roman
Varkuta - Oleksander Letnikov
License
MIT
All versions of turbosms-message-delivery with dependencies
guzzlehttp/guzzle Version ^6.5.8 || ^7.4.5
horat1us/environment-config Version ^1.4
wearesho-team/message-delivery Version ^2.0

