Forum Discussion
Srihari_Gilaka
Nov 02, 2020Copper Contributor
Azure logic app: SendGrid- Send email (v4)- Attach array variable for multiple files is not working
I was attached an array variable with multiple blob file names and content to 1) Send Grid -Send email(v4) - Is not working 2) Office 365 - Send an email(v2) is working Please find attached the...
phurst
Apr 06, 2021Copper Contributor
I have just been through this learning curve myself.
The SendGrid API ( https://sendgrid.com/docs/api-reference/ ) states that you need to provide key name 'content' in the array object. This is different to O365 which accepts 'ContentBytes'.
This is why you are seeing the error returned 'Parameter \"Content\" should be provided' with SendGrid.
Just change the 'Append to array variable' step with the following value selected from the Dynamic content list -
{
"content": FileContent,
"filename": List of Files DisplayName
}
Note - The File Content value needs to be Base64, so in Logic App go to Expression > Base64 then go back to Dynamic content and select File Content with brackets -
base64(body('Get_blob_content'))
Hope this helps.
The SendGrid API ( https://sendgrid.com/docs/api-reference/ ) states that you need to provide key name 'content' in the array object. This is different to O365 which accepts 'ContentBytes'.
This is why you are seeing the error returned 'Parameter \"Content\" should be provided' with SendGrid.
Just change the 'Append to array variable' step with the following value selected from the Dynamic content list -
{
"content": FileContent,
"filename": List of Files DisplayName
}
Note - The File Content value needs to be Base64, so in Logic App go to Expression > Base64 then go back to Dynamic content and select File Content with brackets -
base64(body('Get_blob_content'))
Hope this helps.