Hi folks,
I'm hoping to integrate sms reminders for bookings made through a form on my website.
The SMS service company have provided the following template:
Firstly, I'm not at all sure how to integrate this code into my form - i.e. what goes where in the cURL configuration. I'm a novice, but did know the change "youremailaddress" to my email address etc :p
Also, I need the code to be dynamic and use information submitted to the form by the user - mobile phone number, customer name and booking date/type. So that the sms would be sent to the mobile number entered in the form and the sent sms would read something like:
"Hello {customer_name}. Your car is due for {booking_type} on {booking_date}...."
I also want to schedule the sms, which I believe can be done, to be sent 3 days before the booking date - as a booking reminder basically. I know this is asking a lot, if I just get the code in and working I'll be delighted.
Looking forward to any responses 😀 ,
Cheers
terrance85
I'm hoping to integrate sms reminders for bookings made through a form on my website.
The SMS service company have provided the following template:
<?php
// Authorisation details
$uname = "youremailaddress";
$pword = "yourpassword";
// Configuration variables
$info = "1";
$test = "0";
// Data for text message
$from = "Jims Autos";
$selectednums = "440000000000";
$message = "Test with an ampersand (&) and a £5 note";
$message = urlencode($message);
// Prepare data for POST request
$data = "uname=".$uname."&pword=".$pword."&message=".$message."&from=". $from."&selectednums=".$selectednums."&info=".$info."&test=".$test;
// Send the POST request with cURL
$ch = curl_init('http://www.txtlocal.com/sendsmspost.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch); //This is the result from Textlocal
curl_close($ch);
?>
Firstly, I'm not at all sure how to integrate this code into my form - i.e. what goes where in the cURL configuration. I'm a novice, but did know the change "youremailaddress" to my email address etc :p
Also, I need the code to be dynamic and use information submitted to the form by the user - mobile phone number, customer name and booking date/type. So that the sms would be sent to the mobile number entered in the form and the sent sms would read something like:
"Hello {customer_name}. Your car is due for {booking_type} on {booking_date}...."
I also want to schedule the sms, which I believe can be done, to be sent 3 days before the booking date - as a booking reminder basically. I know this is asking a lot, if I just get the code in and working I'll be delighted.
Looking forward to any responses 😀 ,
Cheers
terrance85