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

How to add an image to a Visualforce email template without using hard coding?
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:
The link where I found such a possible solution is this:
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).
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-templaThe 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).
Does this help?
Shawn
In our case, the image was uploaded as a content asset(https://help.salesforce.com/articleView?id=000320130&type=1&language=en_US&mode=1)
Solution: Hope this helps.