Termii provider for AdonisJS.
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=
Simply call it using:
const Termii = use("Termii");
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);
};
For more information, kindly check out the Termii Official Documentation.
If you find any issue, bug or missing feature, please kindly create an issue or submit a pull request.
Adonis Termii is open-sourced software licensed under the MIT license.