Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dialog-sms-service

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dialog-sms-service

Javascript library for send sms using dialog SMS gateway

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35
decreased by-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

Dialog SMS Service

JavaScript library to send SMS through Dialog telecommunication service

This library will handle single or multiple SMS send feature with Dialog telecommunications service.

npm install dialog-sms-service

Usage

const smsGateway = require('dialog-sms-service');

(async () => {
  try {
    // set configuration
    await smsGateway.setConfig({
      digest: 'dialog_msg_digest_here',
      mask: 'dialog_msg_mask_here',
      user: 'dialog_msg_user_here',
      campaignName: 'dialog_msg_campaignName_here', //optional
    });

    //send message
    const result = await smsGateway.sendSMS('07XXXXXXXX', 'Dialog sms test');
    console.log(result);
  } catch (error) {
    console.log(error);
  }
})();

How to work

First needs to contact Dialog Axiata PLC to get credentials for the SMS gateway.

Note:- Please contact Dialog Axiata PLC in order to obtain following fields.

FieldDescription
UsernameUser name for the Dialog SMS gateway account.
PasswordPassword for the Dialog SMS gateway account.
maskText that appears as the sender of the SMS. Eg:- PIZZAHUT
set configurations for the SMS gateway
// set configuration
await smsGateway.setConfig({
  digest: 'dialog_msg_digest_here',
  mask: 'dialog_msg_mask_here',
  user: 'dialog_msg_user_here',
  campaignName: 'dialog_msg_campaignName_here', //optional
});
FieldDescription
userRequired. Username that will provided by Dialog.
maskRequired. A String. SMS sender ID.Mask value provided by Dialog. Eg:- test (For the test account)
digestRequired. md5 encripted values of password. {digest = md5(password provided by dialog)}
campaignNameOptional. Campaign name to be used in reporting.
Send SMS
await smsGateway.sendSMS(Phone Number ,Message);
FieldDescription
Phone NumberRequired. A String. Phone number/s which will need to receive SMS. the phone number needs to either start with 0 or 94 (do not use +94). If there are multiple receivers make sure to add them as comma (,) separated text. Eg :- '0771111111,0712222222'
MessageRequired. A String. The content of the SMS goes here.

Licence

(The MIT License) Copyright (c) 2021 kmkasunmadushanka@gmail.com

Keywords

FAQs

Package last updated on 26 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc