Forums

How to use {recordtime} in the email templates

I can make most of the fields in the Database work in the e-mail template except the recordtime.

Like to other fields, I'm using {recordtime} but in the e-mail I get "{recordtime}" not the date and time retrieved from the database. Is this a bug or am I simply doing something wrong?

Thanks
nml375 22 Jun, 2010
Hi,
Try setting the order on the DB Connections-tab to before email. Let me know if this does not solve the issue, or you are having troubles finding the setting.

/Fredrik
Just a qucik add-on to my previous question.

Is it possible to display only the DATE and not the TIME?

K
nml375 22 Jun, 2010
Hi,
That is possible, but takes some scripting.
If you don't need HTML-emails, the simplest thing would be to disable the HTML-editor in your email template, and add this piece of code where you'd like the date:
<?php echo date('Y-m-d'); ?>


If you need HTML-emails though, you'll have to be alittle more creative:
First, add some code to simulate a form field value that we'll call "dummydate":
On Submit - before Email
<?
JRequest::setVar('dummydate', date('Y-m-d'), 'post');
?>


Next, in your email template, add {dummydate}

/Fredrik
Thanks, This worked perfectly.
1. It inputted the date into my Database.
2. It placed the date into the location on my e-mail
3. It was there with Chrono Connect.

Thanks again
SPABO 06 Jul, 2010
I have put this in the HTML code

<input type='hidden' name='verstuurd' value='<?php echo date('d-m-Y'); ?>' />
<input type='hidden' name='tijd' value='<?php echo date('H:i:s'); ?>' />


In this way I can use HTML in the emailtemplates

Send on {verstuurd}
at {tijd}
This topic is locked and no more replies can be posted.