How to Send D365 CRM Emails with Attachments Using Power Automate
Introduction
In this guide, we’ll walk through the process of sending emails from D365 CRM with attachments using Power Automate. This step-by-step approach will help you understand how to automate your email communications from CRM with attachments efficiently.
Use-Case
Let’s say you’re working on a project where you need to send emails from D365 CRM that include attachments. In this example, the document is stored in SharePoint, and its URL is linked within the CRM record. This setup is common in CRM where files are centrally stored in SharePoint but need to be easily accessible in CRM for email communication and tracking in CRM. However, this approach is versatile—whether you want to attach specific documents, generate them dynamically, or handle a range of file types, it can be adapted to meet your use-case needs.
Why this solution?
Main objective of using D365 Emails is the ability to track the emails to the record to keep track of communications in timeline. Also, manually attaching documents to each email is time-consuming and prone to errors.
With Power Automate, you can automate this process, ensuring that every email includes the right attachment without extra steps. This solution not only saves time but also reduces the risk of sending incorrect or outdated files, keeping your communications accurate and efficient.
Implementation – Step by Step
As per my use-case, I have added a column in Accounts table that will hold my SharePoint file URL which I’ll use in power automate.
Step 1: Trigger the Flow when a flag is marked true to send email report.
Step 2: Get the file content using SharePoint path
Step 3: Create a new ‘Email Message’ record in data verse (Add a new row)
Step 4: Add a new row for ‘Attachments’ and link to email message record
Add the custom value as shown below
Add Base64 to your file content
Add file name
Step 5: Send the email
That’s it
Let’s test it – Results
Trigger the flag (as per my use-case)
The Email record with attachment
Conclusion
By integrating Power Automate to handle attachments from SharePoint, you streamline your email process, save time, and minimize errors. This solution is especially valuable for cases requiring frequent attachments or centralized file storage, as it keeps communication efficient and files up-to-date.
We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at [email protected]