Skip to content

SMS

A library to send SMS messages to valid phone numbers.

The following list of providers are currently implemented to send SMS:

  • Routemobile;
  • Default (mock).

Example

js
//imports
import { sendSMS } from '@fingermarkglobal/sms';

//hooks
const [smsState, setSmsState] = useState(null);

//SMS provider settings
const settings = {
  type: 'routemobile',
  routemobile: {
    source: 'KFC',
    username: 'username',
    password: 'password',
    endpoint:
      'https://sms.rmlconnect.net/bulksms/bulksms?dlr=1&destination={{phoneNumber}}&message={{message}}&username={{username}}&password={{password}}&source={{source}}',
  },
};

//library main function
sendSMS({
  countryCode: 55,
  phoneNumber: 999865543,
  message: 'Receipt SMS',
  settings,
  transition: machine => setSmsState(machine.value),
});