Hi, new user here.
Just checking out nuBuilder's features and I wonder if it is possible to send SMS from this software? Preferably with Twilio as I have an account. Thank you.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
send sms
Re: send sms
amit,
You asked...
All I know is, you can't from nuBuilder directly without a 3rd party API.
Steven
You asked...
I am not sure.I wonder if it is possible to send SMS from this software?
All I know is, you can't from nuBuilder directly without a 3rd party API.
Steven
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: send sms
Hi and welcome!
It's best to do this with PHP, because it won't reveal your credentials.
Add this code in the "After Save" (PHP) event of your form:
It's best to do this with PHP, because it won't reveal your credentials.
Add this code in the "After Save" (PHP) event of your form:
Code: Select all
// sms_to and sms_txt are fields of your form, replace them!
sendSMSTwilio("+12685555555","#sms_to#", "#sms_text#");
function sendSMSTwilio($from, $to, $body) {
$id = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // replace with your Account SID
$token = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; // replace with your Auth Token.
$url = "https://api.twilio.com/2010-04-01/Accounts/$id/Messages.json";
$data = array (
'From' => $from,
'To' => $to,
'Body' => $body
);
$post = $data;
$x = curl_init($url);
curl_setopt($x, CURLOPT_POST, true);
curl_setopt($x, CURLOPT_RETURNTRANSFER, true);
curl_setopt($x, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($x, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($x, CURLOPT_USERPWD, "$id:$token");
curl_setopt($x, CURLOPT_POSTFIELDS, $post);
$y = curl_exec($x);
curl_close($x);
$out = explode('|', $y);
nuDebug($out);
}
You do not have the required permissions to view the files attached to this post.
-
- Posts: 36
- Joined: Sat Jun 02, 2018 1:26 pm