diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 77ae1ff0baa5..b034b5754962 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -85,7 +85,7 @@ # PRLabel: %Communication - Email # ServiceLabel: %Communication - Email -/sdk/communication/communication-email/ @yogeshmo +/sdk/communication/communication-email/ @yogeshmo @natekimball-msft @kagbakpem # PRLabel: %Communication - Job Router # ServiceLabel: %Communication - Job Router diff --git a/sdk/communication/communication-email/CHANGELOG.md b/sdk/communication/communication-email/CHANGELOG.md index 710f839fc7da..c216a9563e29 100644 --- a/sdk/communication/communication-email/CHANGELOG.md +++ b/sdk/communication/communication-email/CHANGELOG.md @@ -1,15 +1,11 @@ # Release History -## 1.0.1-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 1.0.1-beta.2 (2024-12-23) ### Other Changes +- Updated the README with inline images example. + ## 1.0.1-beta.1 (2024-08-26) ### Features Added diff --git a/sdk/communication/communication-email/README.md b/sdk/communication/communication-email/README.md index 2bc9ba3632d0..82896a126da4 100644 --- a/sdk/communication/communication-email/README.md +++ b/sdk/communication/communication-email/README.md @@ -157,6 +157,39 @@ const poller = await emailClient.beginSend(message); const response = await poller.pollUntilDone(); ``` +### Send Email with Inline Attachments + +Azure Communication Services support sending email with inline attachments. +Adding an optional `contentId` parameter to an `attachment` will make it an inline attachment. + +```javascript Snippet:Azure_Communication_Email_Send_With_Attachments +const imageBuffer = await fs.readFile("C:/path/to/my_inline_image.jpg"); +const contentInBase64 = imageBuffer.toString("base64"); + +const message = { + senderAddress: senderAddress, + content: { + subject: "This is the subject", + plainText: "This is the body", + html: 'This is the body
', + }, + recipients: { + to: [{ address: recipientAddress, displayName: "Customer Name" }], + }, + attachments: [ + { + name: "myinlineimage.jpg", + contentType: "image/jpeg", + contentInBase64: contentInBase64, + contentId: "inline_image", + }, + ], +}; + +const poller = await emailClient.beginSend(message); +const response = await poller.pollUntilDone(); +``` + ## Next steps - [Read more about Email in Azure Communication Services][nextsteps]