Visualforce email template - letterhead issue - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Sara MonksfieldSara Monksfield 

Visualforce email template - letterhead issue

Hi all,

I know this is a developer issue really but I was hoping that someone may be able to point me in the right direction.
I have created my first VF email template can't get the letterhead to display at all.

I have saved the image in a folder accessible by all users, and the image is externally available.  However the image doesn't show on the preview or on the email that I receive when I test it.  It looks no different to when I don't include the image part.

This is the code (image part in italics):

<messaging:emailTemplate subject="SUBJECT LINE"
recipientType="Contact"
    relatedToType="Opportunity"
 replyTo="ABC@RSC.org" >
   
<apex:image id="Campaign_email_template_1_header"
value="https://c.cs84.content.force.com/servlet/servlet.ImageServer?id=0155E000000DOpG&oid=00D5E0000008mQr&lastMod=1491232024000"
height="64" width="64"/>


<messaging:htmlEmailBody >        
    <html>
        <body>
        
         <STYLE type="text/css">
                  TH {font-size: 14px; font-face: arial;background: #FFFFFF; border-width: 0;  text-align: center }
               TD  {font-size: 14px; font-face: arial }
             
             </STYLE>
           <font face="arial" size="2">
      <p/>  Dear  blah blah blah...

<br/>Best wishes
<br/>

       </font>
          </body>
        </html>
    </messaging:htmlEmailBody>  
   
</messaging:emailTemplate>


Can anyone give me any ideas as to where I've gone wrong please?
Best Answer chosen by Sara Monksfield
Patrick SullivanPatrick Sullivan
If you are going to put the image in the body of the email, it needs to go in the HTML Body tags. 

All Answers

Patrick SullivanPatrick Sullivan
If I remember correctly, letterheads are for HTML emails, not VF emails. So, that might be your issue. 

Here is the format for adding images in general:
https://help.salesforce.com/articleView?id=email_template_images.htm&type=0
Sara MonksfieldSara Monksfield
Thanks Patrick, that's one of the resources I used. :)

That link gives for the Visualforce example:
<apex:image id="Logo" value="https://yourInstance.salesforce.com/servlet/servlet.ImageServer? id=015D0000000Dpwc&oid=00DD0000000FHaG&lastMod=127057656800" height="64" width="64"/>

As far as I can see, my code of
<apex:image id="Campaign_email_template_1_header"
value="https://c.cs84.content.force.com/servlet/servlet.ImageServer?id=0155E000000DOpG&oid=00D5E0000008mQr&lastMod=1491232024000"
height="64" width="64"/>

is the same format, so I don't know why it won't work.
 
Patrick SullivanPatrick Sullivan
Can you screen shot the image with its details in docs?
Sara MonksfieldSara Monksfield
If I right click on the image and do 'copy image location' I get this:

https://c.cs84.content.force.com/servlet/servlet.ImageServer?id=0155E000000DOpG&oid=00D5E0000008mQr&lastMod=1491232024000

It looks like this:
User-added image
Patrick SullivanPatrick Sullivan
If you are going to put the image in the body of the email, it needs to go in the HTML Body tags. 
This was selected as the best answer
Sara MonksfieldSara Monksfield
You are a star!!!  Thank you, I've just got to get the size right now but I can see the image.

Thank you. :)