cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tomka5050
Frequent Visitor

Email Attachments Do Not open

Hello,

 

i have a flow that scans through a SharePoint list and sends an email if the Date is today in the given time provided in a Date/Time column.

Users could attach items to the different list items.

I have managed to send out emails with the flow in the given times but I have two issues:

1. Email attachments are not opening in the sent emails

2. If there are more than one emails to be sent then the attachments from the first item is added to the second email.

 

I have tried the base64(dynamicfilecontent) in the append to array variable after the ContentBytes, but the result was the same.

 

Many thanks for your support in advance!

 

 

1.PNG2.PNG3.PNG4.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

What you see as Attachment Content is the Body of the Get attachment.  But the content you are getting doesn't include a content type.  That's why it won't open.  How are the attachments added to the SharePoint list?  That may be where the problem resides. But the reason they won't open is because you have the content, but the system doesn't know what the content is since there is no content type.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

1) Make sure the display name you are using when building the attachments array contains a file extension.  Depending on the attribute you are using it can be the file name without the extension.  That can cause a problem when trying to open the file.

2) At the top of your Yes side of the condition make sure you set the attachments array equal to an empty array.  Otherwise it doesn't get overridden if there are attachments in a previous item.  



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Many thanks for your note!

#1 Please find the result of the Append to array variable. Based on that it seems that the file name is correct but the content is not copied.

 

attachment.PNG

email.PNG

  #2 is solved now with the provided solution, Thank you!

The ContentBytes is more than the Content of the Attachment.  There is also a content type setting.  You should be using the Body of the Get Attachment Content rather than the Attachment content.

image.png

When you are done ContentBytes should look more like this.

"ContentBytes": {
"$content-type": "application/pdf",
"$content": "JVBERi0xLjYNJeLjz9MNCjE0MiAwIG9iag08PC9G....

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I can not select the Body of the Get Attachment Content on the Attachment content

 

reply.PNG

What you see as Attachment Content is the Body of the Get attachment.  But the content you are getting doesn't include a content type.  That's why it won't open.  How are the attachments added to the SharePoint list?  That may be where the problem resides. But the reason they won't open is because you have the content, but the system doesn't know what the content is since there is no content type.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Tomka5050
Frequent Visitor

Hi,

 

yes this was the issue, many thanks for your support!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,044)