azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

[FEATURE REQ] Communicataion Email : Allow setting attachment content disposition as inline

Open Saurav-S-Purushothaman opened this issue 1 year ago • 8 comments

Is your feature request related to a problem? Please describe. When using the EmailAttachment from the @azure/communication-email, we can attach files to the email by initialising this class with the following properties.

  1. name (String)
  2. contentType (String)
  3. content (BinaryData)

While this woks for general attachments (like documents, etc), this class is quite limited if we want to use the attachments to display images inside our email.

To be able to send emails while avoiding loading external images (which are blocked by default in most email clients), it is a common pattern these days to add an image as attachment and display it using its content ID (eg: <img src="cid:logo" alt="Company"/>)

For this to work, the Content-Disposition header should be set as inline, instead of the now default attachment. (eg: Content-Disposition: inline; filename="logo.png"; size=16864;)

And the Content-Id also seems to be randomly generated by Azure (eg. Content-Id: <961cf742-4ea9-445e-96e4-58e256928715>), which makes it impossible to properly reference the image by its own ID from the email body template.

Describe the solution you'd like Would be really helpful to allow this properties/headers to be set when adding the attachment, by expanding the current EmailAttachment class.

This was an already asked request. Just want to make sure that this is extended for azure-java-sdk

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Description Added
  • [x] Expected solution specified

Saurav-S-Purushothaman avatar Apr 26 '24 07:04 Saurav-S-Purushothaman

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kushagraThapar @pjohari-ms @TheovanKraay.

github-actions[bot] avatar Apr 26 '24 07:04 github-actions[bot]

@joshfree looks like this got assigned to the wrong team, can you please route it correctly, thanks!

kushagraThapar avatar Apr 26 '24 15:04 kushagraThapar

@acsdevx-msft as there isn't a CODEOWNER for email

alzimmermsft avatar Apr 30 '24 12:04 alzimmermsft

@vcolin7 can you work with the communication team to get this routed properly and to get the CODEOWNER entry fixed this week?

joshfree avatar May 06 '24 16:05 joshfree

@joshfree I wanted to follow up on this. Could you please let me know if we can expect this feature to be implemented soon, or if it might not be included in the near future?

If this feature is not going to be implemented, could you please direct me to any resources or guides on the best way to add images in the HTML body of an email to be sent via Azure Communication Servie? As far as I have tried, I could not find any docs.

Thanks!

Saurav-S-Purushothaman avatar May 28 '24 11:05 Saurav-S-Purushothaman

Hey @Saurav-S-Purushothaman, sorry for the late reply.

@yogeshmo would you mind taking a look? Thanks!

vcolin7 avatar Jun 12 '24 00:06 vcolin7

@vcolin7 No problem!

Saurav-S-Purushothaman avatar Jun 12 '24 05:06 Saurav-S-Purushothaman