Cassie Posted June 7, 2022 Share Posted June 7, 2022 Hi I adding in a custom field into an email template. I found out in the link below on how to make it not visible if empty which is great. I also need to know how to format it as well as it's a date custom field, I can seem to get |formatLocalTime to work using {{.H_custom_21|formatLocalTime }} Can anyone point me in the right direction? Link to comment Share on other sites More sharing options...
James Ainsworth Posted June 7, 2022 Share Posted June 7, 2022 Hi @Cassie The formatLocalTime modifier relies on two settings: system.RegionalSettings.timezone & system.RegionalSettings.dateTimeFormat You will need to make sure that these are set in the format that you require. You can quickly access these settings by using Ctrl+Shift+S then search on regional. https://wiki.hornbill.com/index.php?title=Email_Templates Link to comment Share on other sites More sharing options...
Cassie Posted June 7, 2022 Author Share Posted June 7, 2022 2022-06-27 09:45:00Z It's the Z on the end that it won't get rid of. Both the regional settings are configured Link to comment Share on other sites More sharing options...
James Ainsworth Posted June 7, 2022 Share Posted June 7, 2022 Hi @Cassie Try setting the system.regionalSettings.timeZone as well. I'm not sure what affect this may have but you also seem to have a space within your variable at the end, after formatLocalTime. {{.H_custom_21|formatLocalTime }} Link to comment Share on other sites More sharing options...
Cassie Posted June 7, 2022 Author Share Posted June 7, 2022 Thanks @James Ainsworth will give it a try in the morning and let you know if I have further issues Link to comment Share on other sites More sharing options...
Cassie Posted June 10, 2022 Author Share Posted June 10, 2022 @James Ainsworth So I have the time format field now working after changing that last setting. I have the hide if empty field working. But I can't seem to use them both together. Is this the correct esp condition? Thanks Cassie Link to comment Share on other sites More sharing options...
Victor Posted June 10, 2022 Share Posted June 10, 2022 @Cassie the expression you have there is for when the variable would have string values. You are using a date there. Change the expression to: '{{.H_custom_21}}' IS NOT NULL Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now