This statement alone will not work when visualforce is compiled but I am pretty sure you are simply trying to output a custom field on the relatedTo
when the recipient
does not match a certain Record Type. Quick tip, if your condition is producing the same output for both boolean expressions, a refactor is needed.
We can start first by making use of the apex:outputText
attribute which gives us the ability to "render" a message/value based on a condition such as recipient.RecordType.Name != "Guardian"
.
<apex:outputText rendered="{!IF(recipient.RecordType.Name != "Guardian", true, false)}" value="{!relatedTo.Name}"/>
Note, when using relatedTo
you will be asked to also define a relatedToType
in your messaging:emailTemplate
attribute of the visualforce email template. This is the SObject from which the template retrieves merge field data.
You may also place such render in an outer block such as a panel if you have an if-else flow.