I have the date and time for the form submission being printed by PHP on the results page, but I need to get it into the email as well to provide a timestamp for the form submission. Here is the code:
How do I pass this to the email template? Thanks!
// Variable for hours
echo date("l, F d, Y" ,time());
$hourdiff = "1"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 60 * 60);
$melbdate = date(" H:i",time() - $timeadjust);
print ("$melbdate"«»);
How do I pass this to the email template? Thanks!
Hi Greg,
Put this code (without the echo or print statements) in the 'before email' box then put
Bob
Put this code (without the echo or print statements) in the 'before email' box then put
<?php echo $melbdate; ?>
in your template and that should do it.
Bob
Hi Greg,
Put this code (without the echo or print statements) in the 'before email' box then put
<?php echo $melbdate; ?>
in your template and that should do it.Bob
Sorry Bob, where is the 'before email' box? I don't see it at all. I have : Form HTML, Form Javascript, On Submit Code, and Email Template.
thanks,
Greg
Hi Greg,
Then you have an older ChronoForms version, you will need to overwrite all files and add any new files and also add some new field to the database table to get the latest ChronoForms version running!🙂
Cheers
Max
Then you have an older ChronoForms version, you will need to overwrite all files and add any new files and also add some new field to the database table to get the latest ChronoForms version running!🙂
Cheers
Max
Ok, I have overwritten my files, however, it is clear that there are new database fields that I need for this to function. Do you have .sql that I can run to insert the new fields/tables?
Hi Greg,
I don't think that there was ever an upgrade script - I'll go and look though. Which version are you upgrading from?
Bob
I don't think that there was ever an upgrade script - I'll go and look though. Which version are you upgrading from?
Bob
Hi Greg,
I don't think that there was ever an upgrade script - I'll go and look though. Which version are you upgrading from?
Bob
Version 2.0. Alternatively, is there anywhere that the exact table changes are listed, so that I can do it manually?<br><br>Post edited by: Greg R., at: 2007/12/27 18:56
Hi Greg,
Only 1 field I think named : `onsubmitcodeb4` LONGTEXT NOT NULL to the jos_chrono_contact table!
Cheers
Max
Only 1 field I think named : `onsubmitcodeb4` LONGTEXT NOT NULL to the jos_chrono_contact table!
Cheers
Max
Ok, we are not quite there yet.
I overwrote the files to upgrade to 2.36.
I added the field onsubmitb4 to the database.
The 'before email' code field now appears in the admin, and I can successfully save it. HOWEVER, I put the following in 'before email':
And have this line at the top of my email template:
But the date does not appear in the email, even though, as I mentioned, I am using the same functions on the results page.
What did I miss??
I overwrote the files to upgrade to 2.36.
I added the field onsubmitb4 to the database.
The 'before email' code field now appears in the admin, and I can successfully save it. HOWEVER, I put the following in 'before email':
<?php
date("l, F d, Y" ,time());
$hourdiff = "1"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 60 * 60);
$melbdate = date(" H:i",time() - $timeadjust);
?>
And have this line at the top of my email template:
<?php echo $melbdate; ?><br>
But the date does not appear in the email, even though, as I mentioned, I am using the same functions on the results page.
What did I miss??
Hi Greg,
I just tested by putting all the code into the template and it works fine.
I just tested by putting all the code into the template and it works fine.
<?php
// date("l, F d, Y" ,time());
$hourdiff = "1"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 60 * 60);
$melbdate = date(" H:i",time() - $timeadjust);
echo $melbdate;
?>
Bob<br><br>Post edited by: GreyHead, at: 2007/12/29 19:30
Bob, I did the same, and the thing is, php put into the email template is simply not being used at all. What could cause this?
A file not being updated? Which one? A field in which the data type has changed from version 2.0? I suspect that the upgrade is incomplete.
A file not being updated? Which one? A field in which the data type has changed from version 2.0? I suspect that the upgrade is incomplete.
Hi Greg,
I guess you didn't overwrite the frontend files ? under : components/com_chronocontact/ ?
I guess you didn't overwrite the frontend files ? under : components/com_chronocontact/ ?
Hi Greg,
As Max says, looks as though your ChronoForms isn't fully up to date. PHP in the template has been supported since v2.3
It's the components/com_chronocontact/chronocontact.php file that supports this.
Bob<br><br>Post edited by: GreyHead, at: 2008/01/01 12:36
As Max says, looks as though your ChronoForms isn't fully up to date. PHP in the template has been supported since v2.3
It's the components/com_chronocontact/chronocontact.php file that supports this.
Bob<br><br>Post edited by: GreyHead, at: 2008/01/01 12:36
Guys, thank you for all your help, but that is not it. My main/administrator/components/com_chronocontact/chronocontact.php file is the latest version. As far as I can tell, anything within <?php> tags in my email template is being ignored.
This topic is locked and no more replies can be posted.