.net - Azure 逻辑应用程序 : How to Send an Email with one or more attachments after getting the content from Blob storage?

标签 .net azure azure-blob-storage azure-logic-apps workflow-definition-language

我想使用Azure 逻辑应用获取 Blob 内容连接器读取 Blob 内容,并使用 Azure 逻辑应用发送电子邮件连接器通过电子邮件将该内容作为附件发送。

附件可以是一个或多个。

发送电子邮件需要以下 json 格式的附件数据:

[
  {
    "ContentBytes": "@{body('Get_blob_content')}",
    "Name": "Test"
  }
]

最佳答案

您可以添加添加或修改 blob 时(仅限属性)(预览) 作为触发器,以重点关注您要处理的容器想听。

然后添加获取 blob 内容作为操作以获取 blob 内容。

最后添加发送电子邮件作为向用户发送电子邮件的操作。在这里,我选择 Gmail,并且由于您已添加 获取 blob 内容 操作,因此在 附件内容 列中,您可以插入 文件内容 code> 等于 @{base64(body('Get_blob_content'))}

如果您想添加一个或多个附件,只需点击发送电子邮件操作中的添加新项目即可。

这是设计器屏幕截图和代码 View 屏幕截图。 enter image description here enter image description here

<小时/>

要将动态数量的文件附加到电子邮件,用户界面中可以切换为使用输入数组

toggle-for-dynamic-input

将 UI 更改为类似这样的内容

dynamic-attachments-input

此处的输入需要采用这种格式的项目数组

{
  "Name": "<NameOfFile>",
  "ContentBytes": "<Base64OfFileContent>"
}

关于.net - Azure 逻辑应用程序 : How to Send an Email with one or more attachments after getting the content from Blob storage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51473878/

相关文章:

azure - 使用 Terraform 创建 Azure 资源时出现问题 - 错误 : "Authentication failed, please check your credentials for AzureRM provider"

asp.net - 将 Azure 应用服务请求转发到 Azure Blob 存储

.net - 什么是法师,它有什么用处?

c++ - C# .NET 开发集成与 C++ 集成

c# - LINQ 按问题分组

python - 向主题发送消息时,适用于 Python 的 Azure 服务总线 SDK 导致读取超时

azure - 为 SSIS 包安排 azure 作业的推荐方法是什么

regex - 用于用户输入验证的 Azure Blob 存储正则表达式模式

azure - Azure 存储上的连接池

c# - 防止无效的文本框输入绑定(bind)到业务对象属性?