Skip to main content
September 11, 2023
Question

Embed image in html email

  • September 11, 2023
  • 8 replies
  • 0 views

1. Interface upload image 

2. second interface use document viewer to display image. Pulling image by document ID 

a!documentViewerField(
label: "Laboratory test results image",
document: ri!svcRequest.lab_images,
altText: "5 Digital Transformation Predictions for 2018 and Beyond",
height: "MEDIUM"
)

3. What I need is to pull the same image and display in an email. How would I go able doing so? What I am seeing is that is may not be possible. 

    8 replies

    mikes0011
    Brainy
    September 11, 2023

    I'm pretty sure I've posted a solution for this exact use case in a past comment.  It might take some tricky searching to find, but you should be able to find it.  It will have nothing to do with "document viewer field", since that component is relevant only to in-Appian interfaces.  The email solution relies purely on HTML.

    stewart.burchell
    September 11, 2023

    If you want an email to contain an image then you need to add the relevant HTML tag which usually points at a server where the image is hosted. The email application, when it loads the email, parses the HTML and fetches the document from said server.

    So in your Appian solution if you're uploading a document you need to push it to the server that will host it and get a "handle" to it that you can then embed in the email's HTML.

    September 11, 2023

    =a!documentViewerField(pv!svcRequest.lab_images)

    I tried this by passing in ### image ### in email template 

    I got this response 

    [@attributes=, contents=[@attributes=, disabled=, documentUrl=https://cdernexusdev.static.fda.gov/suite/rest/a/content/latest/docview/jA0ECQMCV4K8lBQbEMIB0n0B_AmlOwvFSndODlPVPg6vqEQTqU8fE6L5yrVlWLJDHAQrfh-q21WHJtVXWuMaB4Nk8oYlRro0pV3fI40lDu9kH2wezuHWuTm3tFW4tV33kFxP9_MMr4W_5Sa90jecdhvTz1zp2WCVzzcdfb9ZzAZ6OvAHdR7EbOuFb5xVbw, documentId=612916, height=, altText=, validDomain=true, actions=], label=, labelPosition=, instructions=, instructionsPosition=ABOVE, helpTooltip=, requiredStyle=, skinName=, actions=, marginBelow=, accessibilityText=, marginAbove=, helpTooltipPosition=]

    So I tried wraping it with <img> tag and change code to 

    =a!documentViewerField(  document: pv!svcRequest.lab_images)

    but got a black response in the email 

    What would you recommend? 

    stefanhelzle0001
    September 11, 2023

    You cannot use Appian UI components in email. You need to use pure HTML code.