mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
Added multi parameter for sending messages.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from monotonic import monotonic
|
from monotonic import monotonic
|
||||||
from requests import (request, RequestException, HTTPError)
|
from requests import (request, RequestException, HTTPError)
|
||||||
@@ -47,18 +48,18 @@ class MMGClient(SmsClient):
|
|||||||
def get_name(self):
|
def get_name(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def send_sms(self, to, content, reference):
|
def send_sms(self, to, content, reference, multi=True):
|
||||||
data = {
|
data = {
|
||||||
"reqType": "BULK",
|
"reqType": "BULK",
|
||||||
"MSISDN": to,
|
"MSISDN": to,
|
||||||
"msg": content,
|
"msg": content,
|
||||||
"sender": self.from_number,
|
"sender": self.from_number,
|
||||||
"cid": reference
|
"cid": reference,
|
||||||
|
"multi": multi
|
||||||
}
|
}
|
||||||
|
|
||||||
start_time = monotonic()
|
start_time = monotonic()
|
||||||
try:
|
try:
|
||||||
import json
|
|
||||||
response = request("POST", "https://www.mmgrp.co.uk/API/json/api.php",
|
response = request("POST", "https://www.mmgrp.co.uk/API/json/api.php",
|
||||||
data=json.dumps(data),
|
data=json.dumps(data),
|
||||||
headers={'Content-Type': 'application/json',
|
headers={'Content-Type': 'application/json',
|
||||||
|
|||||||
Reference in New Issue
Block a user