Hi Guys
I signed up with sms gateway provider who allows me to send a text message to any mobile number from my email account
I simply send it to any number by making up an email address like this:
anynumber@my_gateway_provider.com
So, is there a way of using placeholder in the email recipient's area?
for example:
{$ANSWER_telephone}@my_gateway_provider.com
That way I could create an email template to be sent via swift mailer to an email address that is actually a phone number pulled from submitted form with "@my_gateway_provider.com" added at the end.
Option 2: How about inserting php code via hooks?
Gateway provider has an API for developers so that any website can send email to sms.
Any ideas on how I can integrate it with formools so that it reads the number from my submitted form same as swift mailer does with emails?
here is the code:
and here is an example of form I'm submitting:
Any suggestions would be very appreciated.
Thanks
Kris
I signed up with sms gateway provider who allows me to send a text message to any mobile number from my email account
I simply send it to any number by making up an email address like this:
anynumber@my_gateway_provider.com
So, is there a way of using placeholder in the email recipient's area?
for example:
{$ANSWER_telephone}@my_gateway_provider.com
That way I could create an email template to be sent via swift mailer to an email address that is actually a phone number pulled from submitted form with "@my_gateway_provider.com" added at the end.
Option 2: How about inserting php code via hooks?
Gateway provider has an API for developers so that any website can send email to sms.
Any ideas on how I can integrate it with formools so that it reads the number from my submitted form same as swift mailer does with emails?
here is the code:
PHP Code:
<?php
// Authorisation details
$uname = "my_gateway_username";
$pword = "password";
// Configuration variables
$info = "1";
$test = "0";
// Data for text message
$from = "My company details";
$number = $_POST['number'];
$message = $_POST['message'];
$message = urlencode($message);
// Prepare data for POST request
$data = "uname=".$uname."&pword=".$pword."&message=".$message."&from=". $from."&number=".$number."&info=".$info."&test=".$test;
// Send the POST request with cURL
$ch = curl_init('http://my_gateway_provider.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);
curl_close($ch);
echo $result;
?>
and here is an example of form I'm submitting:
Code:
<form method="post" action="send_sms.php">
<table width="400">
<tr>
<td align="right" valign="top">Number:</td>
<td align="left"><input name="number" type="text" size="30" /></td>
</tr>
<tr>
<td align="right" valign="top">Message:</td>
<td align="left">
<input name="message" type="text" size="30" /></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="" /></td>
</tr>
</table>
</form>
Any suggestions would be very appreciated.
Thanks
Kris