Azure Logic app : How to Send an Email with one or more attachments after getting the content from Blob storage?
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>"
}
Related videos on Youtube
Sagar K
Accomplished Software | web developer with experience in all phases of software/web development life cycle . Skilled in developing business plans, requirement specifications, analysis and conversion of business requirements to architecture. Strong experience in .net & .net core platform : C#, ASP.net MVC, Web API, SQL Server, Windows Azure Knowledge of : Angular Framework, Redux Expert level proficiency with major development tools/portal such as Visual Studio, SQL Server management tool, Azure portal,GIT.
Updated on June 04, 2022Comments
-
Sagar K almost 2 years
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" } ]
-
Sagar K almost 6 yearsJust one correction ! attachment section should be dynamically added as per count of attachment
-
Mayur Beldar about 4 yearsHow to achieve this for multiple containers? Just create new flow?