My client is wanting to receive an notification email with the following in the body:
First Last
Entry URL
Date AND TIME Submitted
So far the only one I can't find is time. Is there a "secret" code for that?
My client is wanting to receive an notification email with the following in the body:
First Last
Entry URL
Date AND TIME Submitted
So far the only one I can't find is time. Is there a "secret" code for that?
There doesn't seem to be a merge tag for time. Will you want to save the time submitted to the entry page as well, or is just having it in the notification e-mail good enough?
We see that the time and date is displayed on the actual entry form in the info box on the top right of the page, so that's good enough on that end, we just need to be able to have it in the email.
I understand that the email is generated as soon as the form is submitted and we can go by the actual email time stamp, but my client has a strict 24-hour turnaround time to get back to anyone submitting to this form, so having it in the actual body of the notification email is pretty critical.
So, I just mocked up a quick thing that you may need to customize based on server settings, but here we go.
First, I went into my functions.php file for my theme and added the following:
function timedisplay( $atts ){
$timesubmitted = date('H:i:s T');
return $timesubmitted;
}
add_shortcode( 'timesubmit', 'timedisplay' );
This created a shortcode. I then added the following to my notifications:
[timesubmit]
Then when I submitted my form, the time came through. Of course for me it came through as UTC, which because of where I live is 4 hours before GMT. This is probably because my server isn't set to Eastern time which is fine for me, but you may need to customize it to show the time in your time zone.