adonis-termii
v1.1.2
Published
Termii provider for AdonisJS
Downloads
6
Readme
Adonis Termii
Termii provider for AdonisJS.
Installation
Simply run:
adonis install adonis-termii
Add Termii provider to your AdonisJS application located at start/app.js
:
const providers = [
// ...
"adonis-termii/providers/TermiiProvider",
];
Add to your .env
file
TERMII_KEY=
Usage
Simply call it using:
const Termii = use("Termii");
Examples
Sending SMS (Generic & Whatsapp)
const Termii = use("Termii");
const sendSms = async () => {
// Send Whatsapp message
const whatsapp = await Termii.sendSms(
"talert",
"+2348123456789",
"This is the ship that made the Kessel Run in fourteen parsecs?",
{ channel: "whatsapp" }
);
// Send generic text message
const generic = await Termii.sendSms(
"talert",
"+2348123456789",
"This is the ship that made the Kessel Run in fourteen parsecs?"
);
console.log(whatsapp.message_id);
console.log(generic.message_id);
};
Official Documentation
For more information, kindly check out the Termii Official Documentation.
Contributing
If you find any issue, bug or missing feature, please kindly create an issue or submit a pull request.
License
Adonis Termii is open-sourced software licensed under the MIT license.