5

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" />
1
  • I have resolved the issue just by adding the Asset Files to the change set.
    – Hardik
    Commented Sep 10 at 11:23

1 Answer 1

9

It looks like Salesforce is getting smart with Email Template to ensure the URLs don't point to a different org.

To resolve this, make sure you add the images embedded in your Email Template. You do this by adding the "Asset File" components/records to your change set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .