I have a packaged Lightning Email Template. I am able to upload an image file to a Lightning Email Template with ease. However, when I then try to move that email template to a new environment (i.e. scratch org) or generate a new package version, I receive the following error:

'Attribute "src" on element is not allowed, or has an invalid value.'

This is clearly a security measure, but I am unsure how I can add an image to a packaged email template without hitting this error. I am seeing a lot of documentation on uploading a Document and referencing that document's url, but the url will be specific to each environment. Is there a way to achieve this with a packaged lightning email template?

Here is the code that is implicitly generated when I upload an image via the UI:

<img alt="myimage-1225567679-612x612 (2)" src="{[devName:myimage1225567679612x612_2]}" style="max-width: 1644.45px; width: 69px; height: 56px;" title="myimage-1225567679-612x612 (2)" width="69" height="56" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.