Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.28k stars 1.95k forks source link

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

Open Saurav-S-Purushothaman opened 4 months ago

Saurav-S-Purushothaman commented 4 months ago

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

github-actions[bot] commented 4 months ago

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

kushagraThapar commented 4 months ago

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

alzimmermsft commented 3 months ago

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

joshfree commented 3 months ago

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

Saurav-S-Purushothaman commented 2 months ago

@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!

vcolin7 commented 2 months ago

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

@yogeshmo would you mind taking a look? Thanks!

Saurav-S-Purushothaman commented 2 months ago

@vcolin7 No problem!