I'm creating an Visual force Email Template with Dynamic Header Image.

For Example: In Account Object I have two custom Fields. Use_Parent_Logo (boolean Value) and Logo_URL__c is the URL field.

The above account is mapped with parent Account. In the Parent account has also have same two Fields, Value may have different in Logo_URL__c.

My Condition is, If the Account Use_Logo = true then Use the account Logo_URL__c


Use the Parent account Logo_URL__c.

 <messaging:htmlEmailBody >
<table align="center" border="0" cellpadding="0" cellspacing="0" style="max-width:100%;" width="100%">
        <td valign="top" width="600">
            <div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; overflow: hidden;"></div>
            <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#F1F3F4" style="background-color:#f8a8af;">
                        <td align="center" style="border:none; padding-top:30px; padding-bottom:30px;" valign="bottom"><a border="0" href="" style="border:none; outline:none;" target="_blank">
                                <img alt="Google Store" border="0" src="{!IF(relatedTo.User__r.Use_Parent_Logo=true,"relatedTo.User__r.Logo_URL__c","https://img1a.flixcart.com/www/linchpin/fk-cp-zion/img/fk-plus_043837.png")}" 
                                style="-ms-interpolation-mode:bicubic;border:none;max-width:100%;outline:none;width: 250px;vertical-align: bottom;" width="32"/></a></td>

Image is not getting in that email. Anyone Please help on this.


Replace with "relatedTo.User__r.Logo_URL__c"


(relatedTo.User__r.Logo_URL__c). Remove the quote and add parenthesis.

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.