如何使用 azure-communication-email 在附件上定义内容 ID?

问题描述 投票:0回答:2

我正在使用 azure-communication-email 库通过 Azure 服务发送电子邮件。

我需要添加 Base64 格式的图像作为附件,并定义一个内容 Id 以在

<img src="cid:myimagecid">
标签中引用它。

问题是 EmailAttachment 只允许定义:

attachment = EmailAttachment(
    name="attachment.png",
    attachment_type="png",
    content_bytes_base64=file_bytes_b64
)

有什么方法可以在附件中定义该Content Id吗?

python azure azure-communication-services
2个回答
0
投票

目前还没有办法(2022 年 9 月),但请关注 GitHub 上的这个问题


0
投票

如果您使用 .NET,请安装 Azure.Communication.Email 包的版本 1.1.0-beta.2。

只需在终端上输入:

dotnet add package Azure.Communication.Email --version 1.1.0-beta.2

其他答案中引用的 git 线程的最后一个答案中提供了其他语言链接此处

© www.soinside.com 2019 - 2024. All rights reserved.