I need to send an email with attachment according to a condition from table. For e.g I have a table XYZ which has column "Flag" and if the column flag value is "N" then it has to pick the values with value as "N from the table and write into a file. This file has to be sent as attachment in an email in Azure data factory. f you can help with the process for this in Azure data factory it should be great.
Per my researching, there is no such activity could send email with attachment,you could vote up this feedback to improve this feature.
As workaround, you could adopt #Raunak Jhawar's suggestion that using SQL Connector Trigger.
Then you could get the value you want into Azure File Storage or Azure Blob Storage.
After that,send email with attachments following this tutorial. Here is s similar case for your reference:Azure Logic app : How to Send an Email with one or more attachments after getting the content from Blob storage?
Related
How can I get the newest file to be attached to the Logic Apps Send Email (Outlook) email body? For example, there was a workflow on my Azure Function that stores the file into Azure blob storage the file will append based on date information on the name of the file, and then this Send Email will attach the file into the body email.
Based on the above shared requirement, we have created a sample workflow in our local environment.
In our workflow we have hardcoded the blobname using the compose action, post that we are checking whether that particular blob is present in the storage account or not.
If the blob is present in the storage account it will pull the content of the blob & it will trigger an email(used Send an email action to sent email) by appending the content of that blob as an attachment to that email.
Here is the logic app screenshot:
Here is the output screenshot:
Note:
In our workflow, we have hardcoded the name of the blob. In your case, you need fetch the blobname from the function app output.
I have a file that gets generated everyday with the format abc_20210901.txt(the ending of the file name is the date when the file was created which is dynamic and changes everyday) in my blob path /storageacct/ABCcontainer/abc_20210901.txt. I need to create a logic app that sends this file as an attachment in an email. I have created the 'send email' action in logic apps, but could not find how I can send this blob file as an attachment in the email.
Thank you for the help :)
At a minimum, you will need a get blob content v2 step followed by the send email step.
Your workflow will look like this.
Your can use Gmail or outlook. In my case, I signed into outlook to send the email. You will need to click on 'Add new parameters' and tick the attachments box to add the attachment field. .
You can then add your file in the Attachments Contents field.
I have created a logic app with trigger " when a new mail arrives at shared mailbox". Now I want to extract the attachment and save it in azure file share.
In for each I am not able to get attachment id.
Also when instead of get attachment when I directly add action " azure file storage -> create file" I am not getting the name of below details in dynamic content and not even getting folder location
also automatically multiple for each loop are coming
when I selected Attachments below thing happened :-
UPDATE 1_
trigger details :-
update 2_____
get attachment is not working it seems
body:
Summarize from the comments, we can't use more than one trigger in logic app. So we can just use "when a new mail arrives at shared mailbox" trigger in it.
Here is my logic app for your reference(I don't configure a shared mailbox, so I use "When a new email arrives" in my logic app):
Your logic app should be like:
=================================Update==================================
=================================Update 2=================================
=================================Update 3=================================
enter image description here[My logic app should trigger when a mail is received in the outlook inbox folder. But I am able to connect to only 1 outlook account. How can I add multiple Outlook accounts? I have a table created in my Azure Table, in that table there is a column 'From_EMAIL_ID', I need to configure this 'From_EMAIL_ID' parameter to my Connection. So in the future whenever new records for my 'From_EMAIL_ID' get inserted in this table, still I should be able to trigger the logic app. In Short, I want to bind the connection in the logic app to the field name 'FROM_EMAIL_ID' in the enter image description hereazure table.]3
Currently a logic app cannot connect to multiple Outlook APIs, so that might be your issue if I'm understanding correctly. There is an open feedback item for this here: https://feedback.azure.com/forums/34192--general-feedback/suggestions/40009840-logic-app-should-be-able-to-connect-multiple-outlo
You can send multiple emails by adding multiple emails to the "To" field, though. https://learn.microsoft.com/en-us/azure/app-service/tutorial-send-email?tabs=dotnet
I am trying the retrieve the body of an email from outlook. if there is any connector in ADF from where I can directly retrieve the data and store in ADLS will be helpful
After my research, ADF does not have a mail connector:
https://learn.microsoft.com/en-us/azure/data-factory/connector-overview
You can use Azure logic app to get the body of the email and save it in ADLS.
You can use When a new email arrives and Create blob connector in the azure logic app:
You can click Add dynamic content to add the email body.