Coder Social home page Coder Social logo

hellosms.js's Introduction

HelloSMS.js

A very simple module for sending SMS using Javascript and the HelloSMS service.

The module is written in async javascript and suitable for NodeJS or similar application. Currently written as a Common JS module but can easily be converted.

I am not affiliated with HelloSMS other than that I use their services for some of my projects.

Example 1: Send message to a recipient

const helloSMS = require('./hellosms.js');
var smsDispatcher = new helloSMS.SMSDispatcher('USERNAME','PASSWORD','0710000000');
var smsMessage = new helloSMS.SMSMessage('0720000000','The text of the message');
smsDispatcher.SendMessage(smsMessage).then((result)=>{
 //Do Stuff
});

Example 2: Send to multiple recipients

const helloSMS = require('./hellosms.js');
var smsDispatcher = new helloSMS.SMSDispatcher('USERNAME','PASSWORD','0710000000');
var smsMessage = new helloSMS.SMSMessage(['0720000000','0720000001','0720000002'],'The text of the message');
smsDispatcher.SendMessage(smsMessage).then((result)=>{
  //Do Stuff
}
});

Example 3: Send at specific time and set some other options

const helloSMS = require('./hellosms.js');
var smsDispatcher = new helloSMS.SMSDispatcher('USERNAME','PASSWORD','0710000000');
smsDispatcher.RequestCallback = false;
smsDispatcher.TestMode = false;
smsDispatcher.AutomaticallyShortenLinks = false;
smsDispatcher.LoggingSubject = "Campagin 5";
var smsMessage = new helloSMS.SMSMessage('0720000000','The text of the message',new Date('2026-01-01'));
smsDispatcher.SendMessage(smsMessage).then((result)=>{
  //Do Stuff
}
});

hellosms.js's People

Contributors

dsorlov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.