From aa7cd385fb6c70ca58f93c2f8869ab934c642496 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 20 Oct 2015 19:40:11 +0000 Subject: [PATCH] Added Optional `from` parameter --- doc/Extensions/Alerting.md | 2 +- includes/alerts/transport.playsms.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/Extensions/Alerting.md b/doc/Extensions/Alerting.md index 3e1efa761..c4ffcafac 100644 --- a/doc/Extensions/Alerting.md +++ b/doc/Extensions/Alerting.md @@ -400,9 +400,9 @@ Here an example using 3 numbers, any amount of numbers is supported: $config['alert']['transports']['playsms']['url'] = 'https://localhost/index.php?app=ws'; $config['alert']['transports']['playsms']['user'] = 'user1'; $config['alert']['transports']['playsms']['token'] = 'MYFANCYACCESSTOKEN'; +$config['alert']['transports']['playsms']['from'] = '+1234567892'; //Optional $config['alert']['transports']['playsms']['to'][] = '+1234567890'; $config['alert']['transports']['playsms']['to'][] = '+1234567891'; -$config['alert']['transports']['playsms']['to'][] = '+1234567892'; ``` ~~ diff --git a/includes/alerts/transport.playsms.php b/includes/alerts/transport.playsms.php index f2fa71cab..812ae4ffe 100644 --- a/includes/alerts/transport.playsms.php +++ b/includes/alerts/transport.playsms.php @@ -21,7 +21,10 @@ * @subpackage Alerts */ -$data = array("u" => $opts['user'], "h" => $opts['token'], "to" => implode(',',$opts['to']), "msg" => $obj['title'],); +$data = array("u" => $opts['user'], "h" => $opts['token'], "to" => implode(',',$opts['to']), "msg" => $obj['title']); +if (!empty($opts['from'])) { + $data["from"] = $opts['from']; +} $url = $opts['url'].'&op=pv&'.http_build_query($data); $curl = curl_init($url);