Skip to content
Edson Francisco

    uSendIt PHP

    Composer package that wraps the API of the Mozambican SMS gateway uSendIt.

    Period
    2022
    Status
    Prototype
    Role
    Package author

    Problem

    The uSendIt API is SOAP and comes documented in a PDF with examples. Every project that needed to send SMS copied those examples its own way.

    Solution

    The vendor's examples were reorganised into a PSR-4 package with one class per operation: single and bulk sending, character count, credits, accounts and schedule. The package was never published on Packagist and has no tests.

    Technical decisions

    1. 01

      Convert accents to ASCII before sending

      A single "ç" or "ã" forces the SMS into Unicode, which costs more and fits only 70 characters. The package converts the text to ASCII before sending.

    2. 02

      Test/production switch by parameter

      A parameter chooses between the vendor's test and production APIs, so development does not spend credits.

    3. 03

      Bulk sending with a campaign ID

      Sending to many numbers carries an event identifier, so the messages of one campaign can be tracked together.

    Images

    No publishable screens: the system needs real data to run or is no longer online.

    Technologies

    • PHP

    Verifiable results

    classes, one per API operation
    15