Azure logic app: SendGrid- Send email (v4)- Attach array variable for multiple files is not working

Copper Contributor

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 error screenshot  and help me to resolve

2 Replies
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.

Do you have any updates on this?  I still must be configuring something incorrectly.  Trying to pass a CSV file into the sendgrid email V4 component.  I have the Content and filename as you have described.   Any help would be greatly appreciated.  Thank you. @phurst 

 

poze9_3-1659543921234.png

 

poze9_2-1659543816463.png