Skip to content

Commit

Permalink
Update Allowing Inbound SMS from Flowroute's new API format (#150)
Browse files Browse the repository at this point in the history
* Update sms_email.php

Commenting out line 159 was it was causing sending emails to fail.

* Update sms_hook_flowroute.php

Update to receive SMS from Flowroute new API format.
  • Loading branch information
mbarvoipdrs authored Dec 4, 2020
1 parent 9eabde6 commit 09eb3e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions sms/hook/sms_hook_flowroute.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
if ($debug) {
error_log('[SMS] REQUEST: ' . print_r($data, true));
}
route_and_send_sms($data->from, $data->to, $data->body);
$from = intval(preg_replace('/(^[1])/','', $data->data->attributes->from));
route_and_send_sms($from, $data->data->attributes->to, $data->data->attributes->body);
} else {
die("no");
}
} else {
error_log('ACCESS DENIED [SMS]: ' . print_r($_SERVER['REMOTE_ADDR'], true));
die("access denied");
}
?>

?>
7 changes: 3 additions & 4 deletions sms/sms_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ function send_sms_to_email($from, $to, $body, $media = null) {
//send email
$ok = send_email($email_to, $email_subject, $email_message);//, $headers);

if()

if($ok) {
if ($ok) {
error_log("[sms] Email Sent Successfully.");
return true;
}else {
} else {
error_log("[sms] Email could not be sent.");
return false;
}
}
}

?>

0 comments on commit 09eb3e1

Please sign in to comment.