TransWikia.com

Document/Static Resource URLS in Email Templates in Source Control

Salesforce Asked on December 30, 2021

Let’s say that I have a Document or a Static Resource which stores an image that I use in an email template. The .email file within my project directory will have something that looks like this:

<img src="https://some-sandbox.na123.content.force.com/servlet/servlet.ImageServer?id=0155xxxxxxxxxxx&oid=00Dxxxxxxxxxxxx" />

What is the best practice for keeping this email in your source control?
Every time this email is deployed to another environment, the domain and the Ids will change.
This is not unique to email templates either. This same issues could arise in a formula field which generates an image and references a Static Resource.

I was thinking it might be a good idea to keep a separate shell file in the project directory and assign all of the URLS to variables and inject them into the files when the project is deployed to a sandbox or production. This would work well for existing files but would require some extra effort from the developer for new static resources or email templates.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP