Images do not display inline

Chris Aylott
Chris Aylott
  • Updated

Synced / received messages images are present but not displayed, this is typically due to content_type not being defined. 

 

To display inline images, you will need to replace the <img> tag's src attribute from cid: to data: like this:
 

<img border="0" width="378" height="173" style="width:3.9416in;height:1.8in" id="m_2324283022094017882Picture_x0020_1" src="cid:17eaf43558ca175ef7">

 
to:
 

<img border="0" width="378" height="173" style="width:3.9416in;height:1.8in" id="m_2324283022094017882Picture_x0020_1" src="data:image/jpeg;base64;<FILE DATA>">

 
where <FILE_DATA> is the file's content that you can get via the `/files` endpoint.

 

Our email component performs the same action via Javascript see our Email Component's repository: https://github.com/nylas/components/blob/15e3b0f4b80f828c671f772598bc988b379159ec/components/email/src/Email.svelte#L815-L829

 

 

Resources:

https://developer.nylas.com/docs/intelligence/clean-conversations/#images 

 

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.