Azure Logic应用程序:从Blob存储中获取内容后,如何发送带有一个或多个附件的电子邮件? [英] Azure Logic app : How to Send an Email with one or more attachments after getting the content from Blob storage?

查看:127
本文介绍了Azure Logic应用程序:从Blob存储中获取内容后,如何发送带有一个或多个附件的电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 azure逻辑应用程序获取blob内容连接器读取blob内容,然后使用azure逻辑应用程序发送电子邮件连接器通过电子邮件将该内容作为附件发送.

I want to read blob contents using azure logic app get blob contents connector and send that contents as attachment via email using azure logic app send email connector.

附件可以是一个或多个.

Attachments could be one or more.

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

Send email requires attachment data in following json format :

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

推荐答案

您可以将When a blob is added or modified (properties only) (Preview)添加为trigger以专注于您要收听的Container.

You could add When a blob is added or modified (properties only) (Preview) as trigger to focus on the Container which you want to listen to.

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

Then add Get blob content as action to get the blob content.

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

Finally add Send email as action to sent email to users. Here I choose Gmail and as you have add Get blob content action, so in Attachments Content column you could insert File Content which is equal to @{base64(body('Get_blob_content'))}.

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

If you want to add one or more attachment, you only need to click Add new item in Send email action.

这是设计器屏幕截图和代码视图屏幕截图.

Here is designer screenshot and code view screenshot.

要将动态数量的文件附加到电子邮件中,UI中有一个切换按钮,可以改为使用输入数组

For attaching a dynamic number of files to an email, there is a toggle in the UI to use an input array instead

将用户界面更改为类似的内容

which changes the UI to something like this

此处的输入要求使用这种格式的项目数组

The input here expects an array of items in this format

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

这篇关于Azure Logic应用程序:从Blob存储中获取内容后,如何发送带有一个或多个附件的电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆