Skip to content

Latest commit

 

History

History
100 lines (86 loc) · 2.19 KB

index.adoc

File metadata and controls

100 lines (86 loc) · 2.19 KB

Plugin SMS

The plugin provides the ability to send SMS messages over several protocols. Submitting can be done using the API for simple process change handler.

Setup

Configuration has to be done depending on used provider.

Required parameters:

sms:type=mts
sms:login=<login>
sms:password=<password>

Optional (with default values):

sms:shortcode=bgerp.org
sms:url=http://mcommunicator.ru/M2M/m2m_api.asmx/SendMessage

Required parameters:

sms:type=tele2
sms:login=<login>
sms:password=<password>

Optional (with default values):

sms:shortcode=bgerp.org
sms:url=https://newbsms.tele2.ru/api/?operation=send

Required parameters:

sms:type=smsc
sms:login=<login>
sms:password=<password>

Optional (with default values):

sms:url=https://smsc.ru/sys/send.php

Multiple Providers

Additionally to the default provider may be configured additional ones, using unique IDs, for example:

# default configuration
sms:type=tele2
sms:login=login
sms:password=pass
sms:shortcode=BGERP
sms:url=https://target.tele2.ru/api/v2/send_message

# additional one with ID=1
sms:1.type=smsc
sms:1.login=login
sms:1.password=pass
...

Usage

It is now possible to send messages in the doExpression script of a simple event handling.

onProcessEvent.1.events=statusChanged
onProcessEvent.1.doExpression=<<END
// phone process paramId 86
phone = processParam.getParamPhoneNoFormat(86);
if (phone) {
    // sending via default provider
    sms.sendSms(phone, "Your appeal is registered with a number " + process.getId());
    // sending via additional provider with ID=2
    // sms.sendSms(2, phone, "Your appeal is registered with a number " + process.getId());
}
END

SMS class object javadoc:org.bgerp.plugin.msg.sms.ExpressionObject[] with API functions is provided by the plugin.