function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Cha Tumtaweetikul 2Cha Tumtaweetikul 2 

Image not Displaying - Visualforce page email notification

Hi,

I'd like to get help figuring out where the image is coming from. It appears as the "x" at the bottom of the email content.
email sample

This email is built using Classic Email Template (visualforce page) - shown below.
 
<messaging:emailTemplate subject="{!IF(relatedTo.Approval_Status__c='Rejected',$Label.TripApprovedEmailSubject2,$Label.TripApprovedEmailSubject1)}" recipientType="User" relatedToType="Trips_Meetings__c">
    <messaging:htmlEmailBody >
        <div style="width: 600px; margin:auto; font-family:Calibri">
            <c:EmailTemplateHeader />
            <apex:outputText escape="false" value="<p>{!relatedTo.Selected_Approver_List__c} {!$Label.TripApprovedEmailBody1} <a href='{!LEFT($CurrentPage.URL,FIND('/',$CurrentPage.URL,9))}{!relatedTo.Id}'>{!relatedTo.Name}</a></p>
                <p>{!$Label.TripApprovedEmailBody2}: {!relatedTo.Trip_Code__c}</p>

                <p>{!$Label.TripApprovedEmailBody5}</p>" 
                rendered="{!relatedTo.Approval_Status__c == 'Approved'}"/>
            
            <apex:outputText escape="false" value="<p>{!$Label.TripApprovedEmailBody7_1} <a href='{!LEFT($CurrentPage.URL,FIND('/',$CurrentPage.URL,9))}{!relatedTo.Id}'>{!relatedTo.Name}</a> {!$Label.TripApprovedEmailBody7_2}.</p>
            <p>{!$Label.TripApprovedEmailBody6} {!relatedTo.Selected_Approver_List__c}</p>
            <p>{!IF(ISBLANK(relatedTo.Approval_Notes__c),'',$Label.TripApprovedEmailBody3 + ': ' + relatedTo.Approval_Notes__c)}</p>" rendered="{!relatedTo.Approval_Status__c == 'Rejected'}"/>
        </div>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>

EmailTemplateHeader is a page component w/ the code below:
<apex:component id="EmailTemplateHeader" access="global">
	<html>

		<body>
			<style type="text/css" >
              hr{
                    color:#477EF5;
                    background: #477EF5;
                    border-width: 3px;
                    border-style: solid;
                    margin: 20px 0px 20px 0px;
                }
              
            </style>
<!-- commented out section -->
		    <hr/>
		</body>
	</html>
</apex:component>

Not sure where the "x" image is coming from. Any help would be great please!!
 
mukesh guptamukesh gupta
Hi Cha,

Your URL looks wrong so please copy and paste the correct url of image by using below steps:

Right-click the image in after open the image record in document and get its reusable URL address. When you use the URL, you reference the copy of the image on the Salesforce server.

Refer compltely in the Link : 
https://help.salesforce.com/articleView?id=email_template_images.htm&type=0 (https://help.salesforce.com/articleView?id=email_template_images.htm&type=0)

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
 
Cha Tumtaweetikul 2Cha Tumtaweetikul 2
Hi Mukesh,

I'm not sure where the image is coming from. The goal is to remove whatever image is there. But once I click to View Source of the image, this is what I'm seeing:
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div style="width: 600px; margin:auto; font-family:Calibri">
	<html>

		<body>
			<style type="text/css">
<!--

              hr{
                    color:#477EF5;
                    background: #477EF5;
                    border-width: 3px;
                    border-style: solid;
                    margin: 20px 0px 20px 0px;
                }
              
            
//-->
</style>
          
		    <hr>
		</body>
	</html>
            <p>content</p>

        </div><img src="https://mtclientconnect--crmteam.my.salesforce.com/servlet/servlet.ImageServer?oid=00D4c0000008bFj&amp;esid=0184c000000DUr0&amp;from=ext">

I'm very confused where the last img tag is coming from??