@azure/communication-email 1.0.1-alpha.20241223.1 → 1.0.1-alpha.20241224.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +33 -0
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -157,6 +157,39 @@ const poller = await emailClient.beginSend(message);
|
|
157
157
|
const response = await poller.pollUntilDone();
|
158
158
|
```
|
159
159
|
|
160
|
+
### Send Email with Inline Attachments
|
161
|
+
|
162
|
+
Azure Communication Services support sending email with inline attachments.
|
163
|
+
Adding an optional `contentId` parameter to an `attachment` will make it an inline attachment.
|
164
|
+
|
165
|
+
```javascript Snippet:Azure_Communication_Email_Send_With_Attachments
|
166
|
+
const imageBuffer = await fs.readFile("C:/path/to/my_inline_image.jpg");
|
167
|
+
const contentInBase64 = imageBuffer.toString("base64");
|
168
|
+
|
169
|
+
const message = {
|
170
|
+
senderAddress: senderAddress,
|
171
|
+
content: {
|
172
|
+
subject: "This is the subject",
|
173
|
+
plainText: "This is the body",
|
174
|
+
html: '<html>This is the body<br /><img src="cid:inline_image" /></html>',
|
175
|
+
},
|
176
|
+
recipients: {
|
177
|
+
to: [{ address: recipientAddress, displayName: "Customer Name" }],
|
178
|
+
},
|
179
|
+
attachments: [
|
180
|
+
{
|
181
|
+
name: "myinlineimage.jpg",
|
182
|
+
contentType: "image/jpeg",
|
183
|
+
contentInBase64: contentInBase64,
|
184
|
+
contentId: "inline_image",
|
185
|
+
},
|
186
|
+
],
|
187
|
+
};
|
188
|
+
|
189
|
+
const poller = await emailClient.beginSend(message);
|
190
|
+
const response = await poller.pollUntilDone();
|
191
|
+
```
|
192
|
+
|
160
193
|
## Next steps
|
161
194
|
|
162
195
|
- [Read more about Email in Azure Communication Services][nextsteps]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-email",
|
3
|
-
"version": "1.0.1-alpha.
|
3
|
+
"version": "1.0.1-alpha.20241224.1",
|
4
4
|
"description": "The is the JS Client SDK for email. This SDK enables users to send emails and get the status of sent email message.",
|
5
5
|
"author": "Microsoft Corporation",
|
6
6
|
"license": "MIT",
|