I am trying to send an email using a Visualforce template and I want that template to include an icon. Is this possible?
Attribution to: dublintech
Possible Suggestion/Solution #1
Sure, <apex:image>
tag or plain old <img>
.
- It cannot be an image from static resources though.
- If you want to use image hosted in your salesforce, best would be to upload it to Documents and tick the "externally available image". And then remember to use full path:
https://{instance id}.salesforce.com/servlet/servlet.ImageServer?id={document id}&oid={your org ig}
Attribution to: eyescream
Possible Suggestion/Solution #2
<apex:repeat value="{!relatedTo.NotesAndAttachments}" var="c" rows="1">
<h3>Signature</h3>
<div align="left"><apex:image url="/servlet/servlet.FileDownload?file={!c.Id}" height="100px"
width="200px" /></div>
</apex:repeat>
If its in Notes and attachment the above code is handy and i have used and its working.
If stored in documents
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
You can pull from documents.Dont pull from static Resource .It never works .
Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4641