Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Formatting the Date in Form Confirmation Email View modes: 
User avatar
Member
Member
scott_hancock-urmc.rochester - 10/12/2012 4:27:13 PM
   
Formatting the Date in Form Confirmation Email
Hi,

We are creating some Forms (BizForms) and we want to send the data back to the user in the confirmation email. One of the fields is a date field. Is there a way to format form data in the email?

We have the following in the email
$$value:Date$$

Which outputs the date and time. We only want to show the date in the email. Is there someway to format it with K# or something?

Thanks,
Scott

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/15/2012 4:10:32 AM
   
RE:Formatting the Date in Form Confirmation Email
Hi Scott,

what about trying the following macro:
{%CurrentDate%}

Please let me know if this will help you.

Best regards,
Martin Danko

User avatar
Member
Member
scott_hancock-urmc.rochester - 10/15/2012 8:05:08 AM
   
RE:Formatting the Date in Form Confirmation Email
Hi,

It's not the current date though. This is the date that the user has chosen in the form but when we output it in the email using $$value:Date$$, it shows the date and time. We only want to print the date in the email response.

Thanks,
Scott

User avatar
Member
Member
scott_hancock-urmc.rochester - 10/18/2012 8:46:51 AM
   
RE:Formatting the Date in Form Confirmation Email
I've tested it and it looks like you can't use k# in a Form (formerly BizForm) email response. So is there any way to format the date as I mentioned above?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/18/2012 5:06:30 PM
   
RE:Formatting the Date in Form Confirmation Email
Hi Scott,

could you please tell how exactly are you creating your notification templates? Are you doing this through CMSDesk or CMSSiteManager? Be more specific so I will be able to write the solution right for you.

Best regards,
Martin Danko

User avatar
Member
Member
scott_hancock-urmc.rochester - 10/18/2012 7:38:15 PM
   
RE:Formatting the Date in Form Confirmation Email
I'm doing this in the new form wizard in CMSDesk, where you can choose to use a custom template. I'm just placing the existing form fields into the response email.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/29/2012 3:14:44 AM
   
RE:Formatting the Date in Form Confirmation Email
Hi,

I would recommend you to create a custom macro.

The links below may also help you with formating the date:
1. Convert Date Format
2. DateTime.ToString() Patterns
3. Custom Date and Time Format Strings

Best regards,
Martin Danko

User avatar
Member
Member
scott_hancock-urmc.rochester - 10/29/2012 2:02:04 PM
   
RE:Formatting the Date in Form Confirmation Email
How do I pass data like this $$value:FormInserted$$ into a macro?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 11/8/2012 7:04:19 AM
   
RE:Formatting the Date in Form Confirmation Email
Hi,

You should be able to use this macro in a very simple format:
{%Date%}
... where Date is name of the field in your bizform.

Best regards,
Martin Danko

User avatar
Member
Member
josht-ci.corona.ca - 3/12/2013 4:59:31 PM
   
RE:Formatting the Date in Form Confirmation Email
I can get the date to display using {%Date%} as shown above, but it still shows the time as 12:00 AM. I want to display only the date without the time. It looks like it would be possible using the following macro parameters:

(format)<format string> or
(todatetime)<default value>

I can't seem to find any documentation on how these might be implemented or what the correct syntax would be.

Any help would be greatly appreciated.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 3/14/2013 10:45:34 AM
   
RE:Formatting the Date in Form Confirmation Email
Hi Josh,

have you tried one of the Macro Parameters? E.g. trim or limitlength?

Best regards,
Martin Danko

User avatar
Member
Member
scott_hancock-urmc.rochester - 5/16/2013 8:35:14 AM
   
RE:Formatting the Date in Form Confirmation Email
I finally got this to work.

I took this:
$$value:FormInserted$$

which outputs this: 5/16/2013 9:22:35 AM

and replaced it with

{% GetDateTime(FormInserted, "d") %}

which outputs this: 5/16/2013

Scott