BulkSMS Overview
BulkSMS
— Module.A Julia package to send SMS (Short Message Service) using BulkSMS API (more exactly HTTP to SMS API)
Install
Pkg.clone("https://github.com/scls19fr/BulkSMS.jl")
Usage
using BulkSMS: BulkSMSClient, send
using BulkSMS: multiple, shorten
include("config.jl")
client = BulkSMSClient(CONFIG["MSISDN"], CONFIG["USERNAME"], CONFIG["PASSWORD"])
message = "My first message"
# response = send(client, message, msisdn="+336........")
@info "Send '$message'"
response = send(client, message) # use client MSISDN by default
# Action when long message can be set using:
# response = send(client, message, action_when_long=shorten) # shorten long message
# response = send(client, message, action_when_long=multiple) # multiple messages
@info "response: $response"
API
Public
BulkSMS.BulkSMSClient
— Type.BulkSMSClient(msisdn, username, password;
base_url=_DEFAULT_BASE_URL,
max_message_len=_DEFAULT_MAX_MESSAGE_LEN)
Create a client that can connect to BulkSMS HTTP to SMS API.
BulkSMS.send
— Function.send(client, message_text; msisdn=nothing, action_when_long::ActionWhenLong=shorten)
Send a text message message_text
to BulkSMS using HTTP to SMS API with BulkSMSClient client
.
BulkSMS.ActionWhenLong
— Type.ActionWhenLong
Enumeration that defines how long message treated
shorten
: if message is too long, it will be shorten.multiple
: if message is too long, several messages will be sent
Private
BulkSMS.BulkSMSClientException
— Type.BulkSMSClientException(s)
BulkSMS client exception.
BulkSMS.BulkSMSResponse
— Type.BulkSMSResponse(response)
BulkSMS response (from response::Requests.Response
).
BulkSMS._crop
— Function._crop(msg, max_len) -> cropped_msg
Crop a message
to max_len
.
BulkSMS._send
— Function._send(client, message_text, msisdn)
Send a text message message_text
using client
.
This is a "low level" function. You should probably use send(...)
insted of _send(...)
See also
- Pushover.jl - A Julia package to send notifications using the Pushover Notification Service