+ Start a Discussion
aka_floaka_flo 

IF statement in Email template

I am trying to create an email template where a section of the email only appears when a drop-down list has a certain value (e.g. lead source is not website).  See my code below.  Can anyone tell me why my IF statement is not working here as the section is always appearing in the email?

 

<table>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Company Name: </b></font></td>
<td width=35%><font face="Arial" size="2">{!Lead.Company}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Company Website:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Website}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Full Name: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.FirstName} {!Lead.LastName}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Title:</b></font></td>
<td width=15%><font face="Arial" size="2" >{!Lead.Title}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Email: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Email}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Phone:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Phone}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Industry Segment:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Industry}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Request Date:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.CreatedDate}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Country: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Lead_Country__c}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Number of Sites: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.of_Sites__c}</font></td>
</tr>
<tr align ="left">
<td></td><td></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Number of Employees:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.NumberOfEmployees}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Topics of Interest: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Topics_of_Interest__c}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>How did you hear about us:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.How_did_you_hear_about_us__c}</font></td>
</tr>
<tr align="left">
<td colspan=4><font face="Arial" size="2" color="#38ACEC"><b>EHS Compliance Digitization Needs: </b></font><font face="Arial" size="2" >{!Lead.Describe__c}</font></td>
</tr>
<tr>
<br><br>
</tr>
</table>
<br><br>
<apex:outputPanel rendered = "{!IF(Lead.LeadSource != 'Website'),true , false)}">

<table>
<tr align="left">
<td colspan="4"><font face="Arial" size="2" color="blue"><b>For Inquiry from a source other than the Gensuite Website, see Assessment Details below:</b></font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Right Size ($500M - $10B): </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Right_Size_500M_10B__c}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Former User/Referral:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Former_User_Referral__c}</font></td>
</tr>
<tr align="left">
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Decision Maker: </b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Decision_Maker__c}</font></td>
<td width=15%><font face="Arial" size="2" color="#38ACEC"><b>Leadership Team Assessment:</b></font></td>
<td width=35%><font face="Arial" size="2" >{!Lead.Leadership_Team_Assessment__c}</font></td>
</tr>
</table>
</apex:outputPanel>

prakash_sfdcprakash_sfdc
Hi,
Can you please try this
<apex:outputPanel rendered = "{!IF(Lead.LeadSource != 'Website', true , false)}">
aka_floaka_flo

Unfortunately, that doesn't fix it.  The section still appears regardless of what is selected in the LeadSource drop-down list.

prakash_sfdcprakash_sfdc
Can you please highlight the code for LeadSource dropdown.