Azure 逻辑应用程序:如何在从 Blob 存储获取内容后发送带有一个或多个附件的电子邮件?
Azure Logic app : How to Send an Email with one or more attachments after getting the content from Blob storage?
我想使用 azure logic app get blob contents connector 读取 blob 内容并使用 azure logic app send email connectorsend email connector.
附件可以是一个或多个。
发送电子邮件需要以下 json 格式的附件数据:
[
{
"ContentBytes": "@{body('Get_blob_content')}",
"Name": "Test"
}
]
您可以将 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
即可。
这是设计器屏幕截图和代码视图屏幕截图。
为了将动态数量的文件附加到电子邮件,UI 中有一个切换开关可以改为使用输入数组
将 UI 更改为类似这样的内容
此处的输入需要采用这种格式的项目数组
{
"Name": "<NameOfFile>",
"ContentBytes": "<Base64OfFileContent>"
}
对我来说,我必须使用以下格式的数组变量。
{
"ContentData": "<Base64OfFileContent>",
"FileName": "FileName.txt"
}
我使用了“FileName”而不是“Name”,我使用了“ContentData”而不是“ContentBytes”。
我想使用 azure logic app get blob contents connector 读取 blob 内容并使用 azure logic app send email connectorsend email connector.
附件可以是一个或多个。
发送电子邮件需要以下 json 格式的附件数据:
[
{
"ContentBytes": "@{body('Get_blob_content')}",
"Name": "Test"
}
]
您可以将 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
即可。
这是设计器屏幕截图和代码视图屏幕截图。
为了将动态数量的文件附加到电子邮件,UI 中有一个切换开关可以改为使用输入数组
将 UI 更改为类似这样的内容
此处的输入需要采用这种格式的项目数组
{
"Name": "<NameOfFile>",
"ContentBytes": "<Base64OfFileContent>"
}
对我来说,我必须使用以下格式的数组变量。
{
"ContentData": "<Base64OfFileContent>",
"FileName": "FileName.txt"
}
我使用了“FileName”而不是“Name”,我使用了“ContentData”而不是“ContentBytes”。