Azure-Samples / communication-services-dotnet-quickstarts

Sample code for Azure Communication Services .Net quickstarts
MIT License
82 stars 112 forks source link

No property to embed an image to email using EmailMessage with Azure Communication Service #51

Closed sammym1 closed 1 month ago

sammym1 commented 2 years ago

Please provide us with the following information:

Ask is for below sample

communication-services-dotnet-quickstarts/SendEmailAdvanced/SendEmailWithAttachments/

Need to Embed an image in the mail body.

I am using EmailMessage and EmailMessage does not have "AlternateViews" property.

It's a ask and not an issue


Thanks! We'll be in touch soon.

matthohn-msft commented 2 years ago

Thank you @sammym1. Acknowledging this ask, we will be looking into this scenario more

MagnusWagner-WIT commented 2 years ago

I would also be interested in this feature.

lnehrin commented 1 year ago

So without the ability to get the CID of an attachment, how does one embed an image into the HTML of an email?? I've had zero luck trying to inline base64.

IberianTops commented 1 year ago

Same here.

Same with PowerAutomate Online, the Send Email action doesn't allow CID to work because the field Content-ID is not defined and passed through, hence you can't reference the attached images. And base64 for example is not supported by Gmail.

Weird since I believe Outlook desktop uses CID when you're sending embedded images. Yet their own automation system, that they've developed, doesn't support it.

gguillen commented 1 year ago

+1 need this

krisbart commented 1 year ago

+1

eltiano commented 1 year ago

+1

ispysoftware commented 1 year ago

this is a show stopper for us :(

EdgarsM commented 1 year ago

+1

yartman commented 1 year ago

+1 here also

Carlstorm commented 1 year ago

+1

roaddirect-development commented 1 year ago

+1

ErikRBergman commented 1 year ago

+1

zzundalek commented 1 year ago

+1

eredwan commented 1 year ago

+1 This is a bit sad that this did not come standard. I have found most of the Microsoft Azure tech that I have evaluated to be subpar at best. Many times things are missing like this. I was evaluating PowerApps and it had trouble showing all available tables for a given connection to Oracle capped at a max array of 2047 or so. It would only show tables in alphabetical order so I was missing any tables after the letter B. When contacting support they had no solution. Anyways, enough of my tangent, please add this feature to embed images to email body.

bpruissen commented 1 year ago

+1

tcrevier commented 1 year ago

I agree, I also need this functionality to use it more broadly. This doesn't seem like it would be difficult add, it is in so many other email sending APIs.

KunalAdu commented 1 year ago

At last, I've found a solution. Instead of using CID, incorporate an img tag containing base 64 content. This will insert an image in the E-mail HTML body. Inside content and html (https://github.com/Azure-Samples/communication-services-javascript-quickstarts/blob/main/send-email-advanced/send-email-attachments/send-email-attachments.js#L22)

\SomeImage

For more details, please refer to: https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/add-images-email-messages

tcrevier commented 1 year ago

@KunalAdu Thanks! That is a reasonable work around for the short term...

jfperren commented 1 year ago

+1! Also need this

leonardogazdek commented 11 months ago

KunalAdu this will not work in gmail unfortunately.

This is a very basic feature, unacceptable that the service doesn't support it. The only real good solution seems to be to host the images yourself and use the src param to point to hosted images.

crlandwe commented 10 months ago

+1

newportg commented 10 months ago

This is needed now please

sabifa commented 10 months ago

Open for nearly 1.5 years and still no response?

freedomsuites commented 7 months ago

+1 : I cannot embed generated images targeted at some email clients (e.g. GMail) without this feature. And no, the workaround provided by @KunalAdu does not work on all email clients.

https://www.caniemail.com/features/image-base64/

sebastianblesgen commented 7 months ago

+1. CID is for us the easiest to not fall in SPAM issues with external links and base64 is not supported by all clients (gmail for instance).

I know we are talking about MS technologies here but our clients do not care what we are using and we can't force everyone to move to Microsoft Outlook.

I can see that CID is generated, but we should be able to specify it.

--=-FvCcAasQtV1ElFTlafUUlA==
Content-Type: image/svg+xml; name=logo.svg
Content-Disposition: attachment
Content-Transfer-Encoding: base64
Content-Id: <0d30f8bc-d2b1-4f29-acd6-13006700285c>

NB: I use the Java EmailAsyncClient

olcaybuyan commented 7 months ago

+1

jrdzha commented 6 months ago

+1

scayze commented 6 months ago

+1

crlandwe commented 6 months ago

Bump, as other users stated, we cannot control what email services our users decide to use. please add gmail support.

tanguy3165 commented 6 months ago

+1

aardvark79 commented 6 months ago

+1

AlexAmin commented 6 months ago

+1

kubop commented 6 months ago

+1 it baffles my mind that such basic feature is not supported after almost 2 years of making a feature request and many people actually wanting it

oliverskawronek commented 6 months ago

Came here, because ChatGPT hallucinated a contentId and disposition property 🙈

I can confirm that using base64 encoded images are not working on:

Only the web.de Android app displays the image correctly. So no, using base64 encoded image is not a work around.

jake-wickstrom commented 6 months ago

+1

haseeb0807 commented 5 months ago

Workaround can be host the images and access by their URL in src param of <img src=""/> Note - SVG images will not show up, it has to be .png

wojbron-blue commented 4 months ago

+1

gayan-d commented 4 months ago

This is a very serious limitation of azure communication services. Unbelivable that it's not supported even after two years.

podvlada commented 4 months ago

+1

mjh737 commented 4 months ago

+1

gako commented 4 months ago

+1

adscreen commented 3 months ago

+1

aeromac commented 2 months ago

Any updates from anyone at Microsoft about this? or workarounds that work in all mail clients?

natekimball-msft commented 1 month ago

Hello everyone,

I realize this thread has been open for quite some time without a response from anyone on our team, and for that, we sincerely apologize. This feature has certainly been a long time coming, but we're very pleased to announce that inline attachments are now available with the most recent release of our REST API and language SDKs. You can find more information on its usage in our inline attachments documentation, in addition to links to our GitHub sample apps so you can get up & running quickly.

Here are links to the releases for each language SDK: .NET (NuGet): Azure.Communication.Email 1.1.0-beta.2 JavaScript (NPM): @azure/communication-email 1.0.1-beta.1 Java (Maven): azure-communication-email 1.1.0-beta.1 Python (PyPi): azure-communication-email 1.0.1b1

In addition, you can test the feature yourself from your Azure portal. Follow the guidance here to create a new Communications resource, or optionally, use an existing one. Head to the resource overview, then Email > Try Email, and give it a test drive.

Again, on behalf of all of us on the ACS Email team, we're sorry for the lack of communication. We hope you enjoy using this feature and our service. If you have any questions, concerns, or suggestions, feel free to contact us through here or reach out to our support team and we will be sure to answer within a few business days. Thank you and enjoy!