Forums

How to add dynamic date d/m/y to the subject of email?

damiandab 02 Mar, 2009
Hello,

I would like to ask how can I add actual date to my email's subject:

ex:
Subject: The form was submitted d/m/y(the date of submission).

Thanks,
Damian
GreyHead 02 Mar, 2009
Hi damiandab,

You can do this easily with a Dynamic Subject. Create a hidden field in your form and make the value the subject that you want and put the field name in the Dynamic Subject box in the Email Setup.
<input type='hidden' name='subject' value='".<?php echo "The form was submitted on".date('d/m/Y'); ?>' />
Not tested and may need debugging.


Bob
damiandab 02 Mar, 2009
Thanks a lot !!!

I made like that:



<?php
$today=date("d/m/Y");
?>

<input type="hidden" name="subject" value="Text text text <?php echo "$today" ?> text text." />



Best,
Damian
This topic is locked and no more replies can be posted.