Sometime when sending emails using email templates we do not
want to show time portion, e.g. BirthDate.
Contact record
Email Template
Email using template
- Create Solution, with email template
- Export Solution to local machine
- Open Customization.xml file.
- Look for email template
- In Email template XML, check presentationxml tag.
It will look like
<template><text><![CDATA[Dear ]]></text><slugs><slug><entity>contact</entity><attribute>fullname</attribute></slug><default></default></slugs><text><![CDATA[ <font face="Tahoma, Verdana, Arial" size=2
style="display:inline;"></font><div>Your date of birth
in system is ]]></text><slugs><slug><entity>contact</entity><attribute>birthdate</attribute></slug><default></default></slugs><text><![CDATA[ </div><div><br></div>]]></text></template>
6. This is decoded HTML, you can use
online HTML decoders to decode, or look for attribute, e.g. BirthDate
< template >< text > <![CDATA[Dear ]] >< /text >< slugs >< slug >< entity >contact< /entity >fullname< /attribute >< /slug >< default >< /default>< /slugs >< text >< ![CDATA[?< font face="Tahoma, Verdana, Arial" size=2 style="display:inline;" >< /font >< div >Your date of birth in system is ]] >< /text >< slugs >< slug >< entity >contact< /entity >< attribute >birthdate < /attribute >< /slug >< default >< /default >< /slugs >< text >< ![CDATA[?< /div >< div >< br >< /div >]]>< /text >< /template >
7.Change < attribute >birthdate < /attribute > to < attribute >birthdate/@date < /attribute >
8. Encode template HTML, and put it back into Customization.xml file in presentationxml tag.
9. Save customization file, Zip and re-import to
CRM.
10. Don't Forgot to publish solution.
Note: It might be when you re-import solution some special character added in template.
Remove special character, save template
Now try now email with same template, and you will see only date portion of BirthDay.
In case want to show only time from datetime field, in email template then change
7.Change < attribute >birthdate < /attribute > to < attribute >birthdate/@time < /attribute >