• Harshit Sethi
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all,

I have been looking for an answer to my question: how to add an image to a Visualforce email template without using hard coding?.
Some say a possibility to add an image is storing the image in the Documents tab and then use this URL for the image:
 
https://AAA.salesforce.com/servlet/servlet. ImageServer?id=BBB&oid=CCC

The link where I found such a possible solution is this:
 
https://salesforce.stackexchange.com/questions/4641/is-is-possible-to-display-an-image-or-icon-in-a-email-using-a-visualforce-templa
The problem is: what about if you have many email templates to deploy in another organization?. Hence, hardcoding within the Visualforce email template in order to show the image, for example, the logo of an organization, is not a good solution.

We have 100 Visualforce email templates using the suggested URL, ok, it works, the image is being shown when you send the email, but as said, the problem is in the deployment of these email templates because of the use of hardcoding.

I would appreciate messages here how you solved this otherwise? (I have read that use of static ressources for this is not recommendable as well).