Forums

How do I insert a unique ID to email?

marcielo 10 Jul, 2009
HI there,
I´m having some trouble inserting any of the default database values into the email template. When I recieve the email after submitting the form I get this:
test1 {cf_user_id}
test1 {uid}
test1 {cf_id}
test1 {Record #n}
test1 {recordtime}

I tried to create some hidden fields with some of the values but that didn't help and it shouldn't be necessary or...?

What I want is a timestamp and a unique value in the mail, like it does in the backend.

I'm using:
ChronoForms_V3.1_RC5.3 and Joomla 1.5.10
GreyHead 10 Jul, 2009
Hi Marcielo,

You can only use the {field_name} syntax for data input from your form. The other information is only available after the data has been saved to the databse and by default this happens after the email is sent.

On the AutoGenerated code tab change the Flow setting to 'Before Email' - this makes the info available earler.

The saved info is then available in the $MyForm->tablerow['jos_chronoforms_form_name'] array. So in your email template you can add
<?php
$info =& $MyForm->tablerow['jos_chronoforms_form_name'];
echo $info['cf_id'];
. . .
?>

Bob

PS I think it's an array not an object.

PPS You'll need to turn the HTML editor off in the Email Setup to add PHP to the template.
marcielo 17 Aug, 2009
Sorry for the very late response 😶
Thanks a lot, I made it work and I appreciate your help
This topic is locked and no more replies can be posted.