For example, if two users that come complete the form provided in the email comes in addition to their data, there is also the first N1 and N2 email came in second
Thank you very much
Stefano
Yes you can. The problem is how to save the serial numbers to know which is the next one. It's easy to do this if you are saving the data to the database, you can set the email to run after the AutoGenerated code and use the cf_id from the database record.
Bob
I will save the data already in the database, help me to understand how should I do? I did not understand much ...
Thanks
Stefano
After the Autogenerated Code has run and saved the info in the table the results are in the $MyForm->tablerow["form_name"] object so I think you can pick up the id from $MyForm->tablerow["form_name"]->cf_id
Bob
Hi riga75,
After the Autogenerated Code has run and saved the info in the table the results are in the $MyForm->tablerow["form_name"] object so I think you can pick up the id from $MyForm->tablerow["form_name"]->cf_id
Bob
Sorry the question Bob 😲 , but the code that I have put the past where you get to do it via email?
Thank you very much
Stefano
It needs to go into the email template to be included in the email.
Bob
I am entered on the form - tempalte emails and I see my email (I take as a reference to that test is: basicDemo and I did so:
Hello Admin,
Some user has submitted a new message for you, the message is submitted:
(message)
cf_id ()
the user's name is: (name)
$ MyForm-> TableRow [ "jos_chronoforms_basicDemo"] -> cf_id
But the email that arrives does not write the wrong id .... where?
thanks
The snippet you need to add is PHP and must go between <?php . . . ?> tags. To add PHP to the Email template you *must* turn off the HTML editor in the Email Setup.
Bob
<? php
$ MyForm-> TableRow [ "jos_chronoforms_basicDemo"] -> cf_id
>
but except when he saves this:
$ MyForm-> TableRow [ "jos_chronoforms_basicDemo"] -> cf_id
>
Please will you find a simple PHP tutorial and check that your PHP is correct and will output a value.
I can't teach you basic PHP here.
Bob
Thank you
I have JCE and I went into the general configuration, but if I turned in within chronoform the editor is always
Hello Admin,
Some user has submitted a new message for you, the message submitted is:
kjhgk
{cf_id}
the user's name is: stefano
seems not to know what must take the value
cf_id ()
The code is this:
<p> Hello Admin, </ p>
<p> Some user has submitted a new message for you, submitted the message is: </ p>
<p> (message) </ p>
<p> the user's name is: (name) </ p>
<p> <br /> <br />
<? php
$MyForm->tablerow["jos_chronoforms_basicDemo"]->cf_id
?>
and the email I get is this:
Hello Admin,
Some user has submitted a new message for you, the message is submitted:
hkljhlkjc sfgdsf
the user's name is: stefan
Thanks
Try
<?php
echo $MyForm->tablerow["jos_chronoforms_basicDemo"]->cf_id;
?>
Bob
now the email that arrives is:
Parse error: syntax error, unexpected T_ECHO in / home / mydomain.com / public_html / components / com_chronocontact / libraries / mails.php (98): eval () 'd code on line 7
We gained an extra space in the copy and paste - should be <?php no spaces.
Bob
Hi riga75,
We gained an extra space in the copy and paste - should be <?php no spaces.
Bob
now the email arrives but this:
DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base Href="http://www.tregima.it//" />
<title> Email </ title>
</ Head>
<body> <p> Hello Admin, </ p>
<p> Some user has submitted a new message for you, submitted the message is: </ p>
<p> kjhgkjhgkjh </ p>
<p> the user's name is: line </ p>
<p> <br /> <br />
<br /> <br />
Submitted by 79.0.75.203 </ body>
</ Html>
I'm no longer sure what the question is. The last but one email you posted looked correct for the template code you've used.
[sendfb][/sendfb]
Bob
Well it took a while to work out but I think there are two changes you need.
First, on the DB Connection tab set "Saving Data/Emails order" to 'Before Email'
Second, you need to make the table name all lowercase in the Email template
<?php
echo $MyForm->tablerow["jos_chronoforms_basicdemo"]->cf_id;
?>
Not basicDemoBob
The email that arrives does not have the ID number of the table
STefano
It's working OK here - just checked again. I'll send you a backup copy of my form.
Bob
I tried to reproduce the same but I also get no cf_id in the email.
1. The name of the form is with lower case
2. I disabled the html editor in the email 'setup emails' tab
3. I changed the setting in the 'DB connection' tab to 'before email'
4. I inserted the code in the 'emails templates' tab:
<?php
echo $MyForm->tablerow["jos_chronoforms_test"]->cf_id;
?>
But nothing happened after submitting the form😟
OK I solved it two minutes after posting... as you can see in the attachment the Email format is set to 'Plain text' change it to 'HTML' and now it works🙂
I hope this can become handy