Cassie Posted June 7, 2022 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?
James Ainsworth Posted June 7, 2022 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
Cassie Posted June 7, 2022 Author 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
James Ainsworth Posted June 7, 2022 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 }}
Cassie Posted June 7, 2022 Author Posted June 7, 2022 Thanks @James Ainsworth will give it a try in the morning and let you know if I have further issues
Cassie Posted June 10, 2022 Author 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
Victor Posted June 10, 2022 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
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