首页 文章

Azure Logic应用程序:如何从Blob存储中获取内容后发送带有一个或多个附件的电子邮件?

提问于
浏览
1

我想使用 azure logic app get blob contents connector 读取blob内容,并使用azure logic app send email connector 通过电子邮件将该内容作为附件发送 .

附件可以是一个或多个 .

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

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

1 回答

  • 3

    你可以添加 When a blob is added or modified (properties only) (Preview) 作为 trigger 来专注于你想听的 Container .

    然后将 Get blob content 添加为 action 以获取blob内容 .

    最后添加 Send email 作为向用户发送电子邮件的操作 . 在这里我选择 Gmail ,因为你添加了 Get blob content 动作,所以在 Attachments Content 列中你可以插入 File Content ,它等于 @{base64(body('Get_blob_content'))} .

    如果要添加一个或多个附件,只需在 Send email 操作中单击 Add new item .

    这是设计师截图和代码视图截图 .
    enter image description here

    enter image description here

相关问题