I am seeing an issue with using an #IF statement in email templates. When we use the TO BE E-MAILED checkbox on a transaction to trigger the system to send an email using the linked email template, the entire #IF statement, including the #ELSE, is ignored. This is causing customers to receive emails with incomplete/confusing content. If we manually (via Communication > Email) send email/template from the same transaction, the #IF statement works as intended. We use a mass update to check this box on transactions daily to send transactional emails.
I did try adding the FreeMarker markup with the ADD FREEMARKER button in the Email Template text editor, wrapping my #IF statement in this. I did not see a result change.
Any guidance is appreciated.
-kirsten
Test template details:
Sales rep (entity.salesrep) on Customer record = Suzi Smith
IF Statement in the email template: Questions? Please contact <#if entity.salesrep?has_content>${entity.salesrep}<#else>Customer Service</#if>
Goal:
If entity.salesrep has content, email content should be: Questions? Please contact Suzi Smith.
If entity.salesrep is blank, email content should be: Questions? Please contact Customer Service.
Results when email is generated from the transaction:
via Communication > Email: Questions? Please contact Suzi Smith.
by checking the TO BE E-MAILED and Saving the transaction: Questions? Please contact .