I'm still new to HTML, but have built a custom Salesforce email template. It has 5 tables in the body of the email and I created an If statement on the display style for each so that the box only appears in the email if my statement is true.

I tested it and it works...for my gmail, but when it goes to Outlook (I sent it to my boss and also to my hotmail account) the statement doesn't work. I have tried researching how to work with Outlook but just get info on the statement and not sure how to use that to make my actual conditional statement to work.

Any help would be appreciated!

Here is my statement that is not firing for Outlook:

    <section style="display: {!If (Lead.Internet__c = TRUE, '', 'none')}">
         content that should only be seen if statement is true 

1 Answer 1


I don't think its the actual IF statement thats the problem. Formula expressions are evaluated by salesforce before the email is sent. You should check the raw source of the email in their inbox, it should have the property value set correctly.

Its much more likely that outlook ignores the display style in favor of their own styles, for a number of reasons (preventing marketing trackers, hidden images, image overlays, invisible links, etc). Each email client is different in what styles it will accept. You may need to add back-up styles (much like making a webpage that targets outdated browsers) to cover all cases.

Seems like outlook ignores display: none, also seen on stackoverflow.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .