The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
adding email to sms function - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: adding email to sms function (/showthread.php?tid=2006)



adding email to sms function - kmielcz - May 9th, 2012

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:
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($chCURLOPT_POSTtrue);
curl_setopt($chCURLOPT_POSTFIELDS$data);
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
$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