How to send an email to the recieptients or the user? example: after submitting the form there will be an email being send to my mail and confirm that ive registered the form already. how to do this tnx
Jan
<?php
$from ="mymail@mymail.co.uk";
$fromname = "ATTI";
$recipient = $_POST['email'];
$subject = "Ticket Registration";
$html_message = "<p>Hi, Thank you for contacting me, I will respond as soon as possible.</p>";
mosMail($from, $fromname, $recipient, $subject, $html_message, true,$ccemails, $bccemails, $attachments, $replyto_email, $replyto_name );
?>
What extra codes I should add to include the ID number?Hi,
Just to add to Max's post - please be clear what ID you want to add? Is it really the CF_id or the user id - or something else?
Bob
<?php
if($paramsvalues->dbconnection == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_Final_Form_App2", "Table");
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );
if (!$row->bind( $post )) {
JError::raiseWarning(100, $row->getError());
}
if (!$row->store()) {
JError::raiseWarning(100, $row->getError());
}
global $row_jos_chronoforms_Final_Form_App2;
$row_jos_chronoforms_Final_Form_App2 = $row;
}
?>
<?php
echo $row_jos_chronoforms_Final_Form_App2->cf_id;
?>
<?php
if($paramsvalues->dbconnection == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_credit", "Table");
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );
if (!$row->bind( $post )) {
JError::raiseWarning(100, $row->getError());
}
if (!$row->store()) {
JError::raiseWarning(100, $row->getError());
}
global $row_jos_chronoforms_credit;
$row_jos_chronoforms_credit = $row;
}
?>
<?php
global $row_jos_chronoforms_credit;
echo $row_jos_chronoforms_credit->cf_id;
?>
<?php
global $row_jos_chronoforms_name;
echo $row_jos_chronoforms_name->cf_id;
?>
add a "dynamic To" and add the field name which will hold the email address of the recipient!
<tr>
<td bgcolor="#D4D0C8"><label class="cf_label">Title *</label> </td>
<td bgcolor="#D4D0C8"><select class="cf_inputbox validate-selection" id="title" size="1" name="title"><option value="Select One">Select One</option><option value=" Mr."> Mr.</option><option value="Mrs.">Mrs.</option><option value="Ms.">Ms.</option></select><a onclick="return false;" class="tooltiplink"><img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div class="tooltipdiv">Title * :: Please select your title.</div> </td>
<tr>
<td bgcolor="#D4D0C8"><label class="cf_label">First Name *</label> </td>
<td bgcolor="#D4D0C8"><input class="cf_inputbox required" maxlength="150" size="30" id="f_name" name="f_name" type="text"><a onclick="return false;" class="tooltiplink"><img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div class="tooltipdiv">First Name * :: Enter your first name. Also know as a given name.</div> </td>
<tr>
<td bgcolor="#D4D0C8"><label class="cf_label">Last Name *</label> </td>
<td bgcolor="#D4D0C8"><input class="cf_inputbox required" maxlength="150" size="30" id="l_name" name="l_name" type="text"><a onclick="return false;" class="tooltiplink"><img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" border="0" height="16" width="16"></a><div class="tooltipdiv">First Name * :: Enter your last name. Also know as a family name.</div> </td>
</tr>
<?php
$title = JRequest::getString('title', '', 'post');
$f_name = JRequest::getString('f_name', '', 'post');
$l_name = JRequest::getString('l_name', '', 'post');
$d_fname = "$title $f_name $l_name";
JRequest::setVar('d_fname', $d_fname, 'post');
?>
Then put d_fname in the Dynamic FromName box<?php
global $row_jos_chronoforms_tablename;
echo $row_jos_chronoforms_tablename->cf_id;
?>
Auto generated code: Before E-Mail
<?php
global $row_jos_chronoforms_tablename;
echo $row_jos_chronoforms_tablename->cf_id;
?>
$emails[0]->subject=$row_jos_chronoforms_Order->cf_id;
global $row_jos_chronoforms_tablename;
before you use this variable, in the same box, are you doing that ?Hi,
you must add
Code: Select all
global $row_jos_chronoforms_tablename;
before you use this variable, in the same box, are you doing that ?
did you try the 2 lines above in the onsubmit after email ? what was the result ?
if($before_email_code){
CFDoRunCode('onsubmitcodeb4', '', $paramsvalues, $debug, $cf_row, $posted);
CFDoRunCode('autogenerated', 'before_email', $paramsvalues, $debug, $cf_row, $posted);
}
if($before_email_code){
CFDoRunCode('autogenerated', 'before_email', $paramsvalues, $debug, $cf_row, $posted);
CFDoRunCode('onsubmitcodeb4', '', $paramsvalues, $debug, $cf_row, $posted);
}
echo $emails[0]->subject;
didn't work, maybe it's my fault;
<?php
global $row_jos_chronoforms_TX06Registration;
echo $row_jos_chronoforms_TX06Registration->cf_id;
?>
If you look near the end of the Autogenerated code you will get a clue about what it should be. Please try this version:<?php
$data =& $MyForm->tablerow["jos_chronoforms_TX06Registration"] ;
echo $data->cf_id;
?>
<?php
$data =& $MyForm->tablerow["jos_chronoforms_TX06Registration"] ;
echo $data->cf_id;
?>
<strong>2010 CSX Beginning and Intermediate Class (TX06) Online
Registration Form</strong>
<br />
<strong>First Name</strong>
<br />
{first_name}<br />
<strong>Last Name</strong>
<br />
{last_name}<br />
<strong>中文名 / Other Name</strong>
<br />
{middle_name}<br />
<strong>Gender</strong>
<br />
{gender}<br />
<strong>Street Address</strong>
<br />
{street_address}<br />
<strong>Supplemental Address 1</strong>
<br />
{supplemental_address_1}<br />
<strong>Supplemental Address 2</strong>
<br />
{supplemental_address_2}<br />
<strong>City</strong>
<br />
{city}<br />
<strong>State</strong>
<br />
{state}<br />
<strong>Postal Code</strong>
<br />
{postal_code}<br />
<strong>Phone (Number only i.e. 7136668888)</strong>
<br />
{phone}<br />
<strong>E-mail</strong>
<br />
{email}<br />
<strong>How did you hear about this class?</strong>
<br />
{radio0}<br />
<strong>Have you attend this class before?</strong>
<br />
{radio1}<br />
<strong>If yes, what is your previous student ID?</strong>
<br />
{old_id}<br />
<strong>Translation Needed?</strong>
<br />
{radio2}<br />
Hi kh28102000,
You need some familiarty with script - or to find someone who has to help you. This is not particularly difficult but it's not trivial either.
The PHP 'echo' outputs the value which is useful for debugging but not what you need here.
I'm sorry, I am very busy at the moment and don't have time to write the code for you.
Bob
Please contact your Internet service provider since part of their network is on our block list.