You need to sign in to do that
Don't have an account?

Custom Field Formula - Image, encapsulated in a VisualForce Email Template
I have set a Custom Field ('Priority_Flags__c') on the Case object, to represent priority flags as follows:

Is there a way to make this work, and render the IMAGE in the VisualForce Email Template?
IMAGE( CASE( Priority, "Low", "/img/samples/flag_green.gif", "Medium", "/img/samples/flag_yellow.gif", "High", "/img/samples/flag_red.gif", "Critical", "/img/samples/flag_red.gif", "/s.gif"), "Priority Flag")I included this custom field to be merged in a VisualForce Email Template as follows:
<messaging:emailTemplate subject="[Assignment] Case #{!relatedTo.CaseNumber}: {!relatedTo.Subject}" recipientType="User" relatedToType="Case"> <messaging:htmlEmailBody > <html> <style type="text/css"> body {font-family: arial; size: 12pt;} </style> <body> The following case was assigned to <b>{!relatedTo.Owner.Name}</b>: <br />------------------------ <br />• Case #: {!relatedTo.CaseNumber} <br />• Account: <apex:outputLink value="https://my.salesforce.com/{!relatedTo.Account}"> {!relatedTo.Account.Name}</apex:outputLink> <br />• Contact Name: {!relatedTo.Contact.Name} <br />• Case status: {!relatedTo.Status} <br />• Priority: {!relatedTo.Priority_Flags__c} {!relatedTo.Priority} <br />• Link: https://my.salesforce.com/{!relatedTo.Id} <br />------------------------ <br /> </body> </html> </messaging:htmlEmailBody> </messaging:emailTemplate>It seems that the rendered Merged Field is not the image as expected, but the img HTML statement:
Is there a way to make this work, and render the IMAGE in the VisualForce Email Template?
Eg Field Name: "Priority_Flags_Url__c"
And use this apex tag in your Visualforce email template:
<apex:image id="theImage" value="{!relatedTo.Priority_Flags_Url__c}" width="20" height="20"/>
All Answers
Eg Field Name: "Priority_Flags_Url__c"
And use this apex tag in your Visualforce email template:
<apex:image id="theImage" value="{!relatedTo.Priority_Flags_Url__c}" width="20" height="20"/>