Skip to content

Commit

Permalink
Adding inline image example to readme (Azure#32290)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
natekimball-msft authored Dec 24, 2024
1 parent 6330370 commit a2634bd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions sdk/communication/communication-email/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
33 changes: 33 additions & 0 deletions sdk/communication/communication-email/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<html>This is the body<br /><img src="cid:inline_image" /></html>',
},
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]
Expand Down

0 comments on commit a2634bd

Please # to comment.