You need to sign in to do that
Don't have an account?

Image broken in Visualforce email when delivered
I am using a static resource which is our company's logo in a visualforce email. I get the image to show up when previewing from the app but not when the email is delivered. I noticed another post that indicates you may need to construct the url for the image in a different way (like in a controller class). Any ideas?
<apex:image value="{!URLFOR($Resource.ZayoLogo)}"/>
@TehNrd is correct. Static image resources are not supported with Visualforce email templates. Support verified this as well.
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_email_templates_stylesheets.htm?SearchType=Stem
Instead I used the document approach using the image url below where id is the document id of the image and oid is the org id.
<apex:image url="https://tapp0.salesforce.com/servlet/servlet.ImageServer?id=01570000000jmOe&oid=XXXXXXXXXXXXXXX"/>
All Answers
I am experiencing the same behavior and opened a ticket with Support which quickly got escalated to Tier 3. My static resouce is public and am using <apex:image url> as well.
<apex:image url="https://tapp0.salesforce.com{!$Resource.Inventory_Close_Out_Email_Header}"/>
What did you end up on doing with your images? Did you defer to using Documents?
I deferred the requirement until I could spend more time on it. I was thinking about putting the resource out on Box.net and loading it from there. Let this thread know when/if you get resolution
thanks
g
@TehNrd is correct. Static image resources are not supported with Visualforce email templates. Support verified this as well.
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_email_templates_stylesheets.htm?SearchType=Stem
Instead I used the document approach using the image url below where id is the document id of the image and oid is the org id.
<apex:image url="https://tapp0.salesforce.com/servlet/servlet.ImageServer?id=01570000000jmOe&oid=XXXXXXXXXXXXXXX"/>
I found this thread very helpful, just a quick note for anyone who stumbles on this that had me banging my head on my keyboard for a while. You need to replace three things in the link supplied by @frasuyet to make it work:
https://AAA.salesforce.com/servlet/servlet. ImageServer?id=BBB&oid=CCC
AAA = your SFDC server, found in the URL of any SFDC link after you log in
BBB = the record ID of your publicly available document
CCC = your organization ID
I'd advise testing it in a browser until you get it right, much easier that way.
Thanks for the thread. It was very usefull for getting my template going. I love how we have to hard code a document ID to get this working. I mean, isn't that against best practices?
THANK YOU for pointing this out!!
What about if you want to use an img within an html attribute like background-image:url(....);
if you do this:
background-image:url(<apex:image id="Logo" value="https://c.cs16.content.force.com/servlet/servlet.ImageServer?id=015f0000000ADiz&oid=00Df0000001PSvt"/>);
no compile errors but the image is not displayed when you send the email.
Any advise?
I have created Custom Email Template and using <img> tag to put an image.
I have uploaded the image in the Documents and made it externally available. But still it doesn't show the image in the HTML Preview.
I am working in the Sandbox environment. Does it matter ?
This post just saved my FACE! Thank you Obi Wan