I have an email template that has body containing this image tag.
<img src="cid:Signature.png" alt="DFA"/>
A button triggers a Send E-Mail Type process that has the following Attachment SQL.
SELECT blob_content
,filename
,mime_type
FROM apex_application_files
WHERE filename = 'Signature.png'
AND flow_id = :APP_ID;
This setup works flawlessly inside email sent. This setup also fails if I use <img src="#APP_FILES#file.png" alt="ALT_TEXT"/> as mentioned in this post
I have a page to preview this email before it gets sent. On this preview page, I am using apex_mail.prepare_template to fetch the email content into a hidden item which is then displayed in a Static Content Region using &P10715_BODY_HTML!RAW.
In the preview, the image cannot load since there is no way of sending an attachment through a SQL or through p_placeholders when I use <img src="cid:Signature.png" alt="DFA"/>. In this case though, <img src="#APP_FILES#Signature.png" alt="ALT_TEXT"/> works just fine.
What is the right way to include images in the body of an email template that works with both Send E-Mail process and apex_mail.prepare_template?
Reference: https://tm-apex.hashnode.dev/preview-of-your-email-apex-mail-3