[SalesForce] Adding logo in visual force email template

I am using a vf email template. I understand to use logo in a vf template i cannot leverage static resources, rather have to keep the logo in documents folder.
But how can i dynamically access the url of the image from the document folder in the template so that the template can be deployed to higher orgs

Best Answer

Refer to: https://help.salesforce.com/apex/HTViewSolution?urlname=Why-images-stored-as-static-resources-cannot-be-seen-in-emails-sent-using-VF-email-templates-1327108316482&language=en_US

It states:

To solve this problem, images should be stored in documents and with "Externally Available Image" checked. The image will be available by using the following markup:

<apex:image id="theImage" 
value="https://c.<instance>.content.force.com/servlet/servlet.ImageServer?id=<document_id>&oid=<organization_id>" 
width="200" height="200"/>

Save the instance value in a custom setting and refer the value dynamically inside url..

Related Topic