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
sbajasbaja 

Visualforce Email template

Hi

 

I have created a Visualforce email template and sending that mail template through a trigger.

I have loaded all the images that I am using in my template as the static resource and accessing it like

 

<apex:image url="{!URLFOR($Resource.Zipfolder, 'folder/image1.jpg')}" width="25" height="100" />

In the preview of the template, I am able to see the images. And the cache control for the static resource is public.

Even though I am not able to see Image in the mail delivered to the recipient.

 

needed help on this.

RamboRambo

Thats bcoz the recipient does not have that image in his static resource.......

sbajasbaja

Thanks for reply .....  But

Even if i store my images in the documents and make them externally available and access it like

 

https://aaa.salesforce.com//servlet/servlet.FileDownload?file=bbb

 

aaa = sfdc server

bbb = id of the document.

 

than also I am not able to view images in the delivered mail.

RamboRambo

try this...

 

<apex:image url="{!URLFOR(!$Resource.Zipfolder, 'folder/image1.jpg')}" width="50" height="50"
/>

sbajasbaja

this is what i had used earlier when i had stored images as static resources but the images are getting displayed in preview but not in the delivered mail.

RamboRambo

Try adding the image in a custom component and den try using this custom component in the VF email template... when using the custom component make the access attribute of custom component as "global" and use it....

DevNVDevNV

@sbaja, did this work for you in the end?  I'm having the same problem with an email template image not resolving.

 

Edit: Looks like it will only work if you load the image into a Document and reference the full URL of the document to display. Replace the link below with your server name (xxx), the document id (yyy) and your Org id (zzz).

 

 

<apex:image value="https://xxx.content.force.com/servlet/servlet.ImageServer?id=yyy&oid=zzz" width="400" height="89"/>