From a2634bde4b30279ae78809df789a892daec39faa Mon Sep 17 00:00:00 2001
From: Nate Kimball <97469387+natekimball-msft@users.noreply.github.com>
Date: Mon, 23 Dec 2024 16:57:32 -0800
Subject: [PATCH] Adding inline image example to readme (#32290)
### Packages impacted by this PR
N/A
### Issues associated with this PR
N/A
### Describe the problem that is addressed by this PR
The "Inline Images" example was missing from the most recent release of
our SDK.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
N/A
### Are there test cases added in this PR? _(If not, why?)_
N/A - readme only
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
---
.github/CODEOWNERS | 2 +-
.../communication-email/CHANGELOG.md | 10 ++----
.../communication-email/README.md | 33 +++++++++++++++++++
3 files changed, 37 insertions(+), 8 deletions(-)
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]