Azure Logic app : How to Send an Email with one or more attachments after getting the content from Blob storage?

不问归期 提交于 2019-12-08 00:21:48

问题


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.

Send email requires attachment data in following json format :

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

回答1:


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.

Then add Get blob content as action to get the 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'))}.

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.


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>"
}


来源:https://stackoverflow.com/questions/51473878/azure-logic-app-how-to-send-an-email-with-one-or-more-attachments-after-gettin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!