1

I have a custom email template (html and text versions). I want to render certain parts of the template based on a multi select picklist value.

I have to render the below 'td' when User.Interests__c=='Host'. The 'td' contains an image. Is this even possible ? (I dont want to go to Visualforce email template)

Here's the most basic code i used, which is NOT working . Im just trying to render the Text - 'Loves Hosting' as per the user Interest. w (Note I used INCLUDES, coz this is multi select picklist field). How to make this working?

{!IF(INCLUDES(User.User_Interests__c,"Host"),"LOVES HOSTING", "NOT A HOST")}

My ultimate aim is render this 'td' with image based on user interest. How?

<td><img src="http://resources.intraxinc.com/logos/logo"></td>

Any suggestions

  • Hi, as you said simple example is working.. Have you tried writing whole td code as a if else result itself ? I guess.. Ut should work... – Jitendra Zaa Aug 7 '14 at 5:05
  • Oops, i thought the sample was working. But it always shows "NOT A HOST", irrespective of the user interest! something is wrong – sfdcFanBoy Aug 7 '14 at 7:17
0

You can have custom formula field on object itself which will perform this check and accordingly correct path will be available in email template...

  • There is still an issue here and it’s not specific to whether the email is HTML or VF template. The fundamental issue is that Site Registration Controller runs as the Guest user (it has to), it creates the Contact record and the User record in one fell swoop during which the Registration email is sent. This is packaged code and is not something we can alter. Any attempt to show User fields is in fact picking up values from the Guest user. Whilst the Email is able to get at the Contact fields, there is no published relationship to the User record to obtain values from the user being created. – sfdcFanBoy Aug 8 '14 at 9:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.