Plugin extensions
What you can add yourself
BulkGate modules can do two things beyond what the administration offers. Both are for developers — you reach into your e-shop's code.
| Extension | What it is for |
|---|---|
| Custom SMS from your code | Send a message from anywhere in your code, even from another plugin |
| Custom variables | Add data the module does not know about to your templates — a tracking number, loyalty points, anything from your database |
Support differs by module:
| Module | Custom SMS | Custom variables |
|---|---|---|
| WooSMS (WooCommerce) | Yes | Yes |
| PrestaSMS (PrestaShop) | Yes | Yes |
| CartSMS (OpenCart) | — | Yes |
Misusing informational SMS for promotional and marketing purposes is strictly forbidden. You may only send transactional SMS this way.
Custom SMS from your code
The message goes out as transactional, is billed from the module's wallet and takes the same route as the notifications the module sends on its own.
WooSMS
PrestaSMS
Sender settings
senderType |
What it means | senderValue |
|---|---|---|
gSystem |
A BulkGate system number | Not used |
gShort |
A short code | Not used |
gText |
An alphanumeric sender | The text shown to the recipient |
gOwn |
Your own phone number | The number in international format |
The older action name woosms_send_sms still works, but use
bulkgate_send_sms for new integrations — it is the same across modules.
Custom variables in templates
With every notification the module gathers data about the order and the customer.
This extension adds your own values to that set, and you then use them in the
template as <variable_name>.
WooSMS
PrestaSMS
The module calls the actionPrestaSmsExtendsVariables hook and hands it an array
with two keys — variables and database:
CartSMS
OpenCart has no hook system, so the extension is done by rewriting a prepared
class in the file system/library/cartsms/cartsms/src/HookExtension.php:
With CartSMS you rewrite a file inside the module itself, so you lose the change when it is updated. Keep a backup and put it back after each update.
Ready-made extensions on GitHub
For the common cases — tracking numbers from carriers, loyalty points, payment references — there are ready-made solutions you only need to install:
| Module | Repository |
|---|---|
| WooSMS | github.com/BulkGate/woosms-extensions |
| CartSMS | github.com/BulkGate/cartsms-extensions |
The _ready-made-solutions folder holds extensions for particular plugins — for
WooSMS these include AfterShip, GLS, Nova Poshta or shipment tracking, for
CartSMS loyalty points and tracking numbers. WooSMS additionally has an empty
skeleton in the woosms-variables-extension folder, a good starting point for
writing your own extension.
Before you start writing your own code, go through the ready-made solutions — often one of them is enough as it is, or needs only the table and column names changed.
Thank you for your feedback.