In this guide, you’ll learn to automatically save emails to PDF using our PDF Converter for Power Automate. In this example, you'll automatically save the body of incoming emails to PDF and archive the results in Dropbox.
It’s also important to note that you can easily customize this example for different email services as a trigger (outlook.com, Outlook for Office 365, etc.). You can also save emails to other destinations, like SharePoint, Google Drive, OneDrive, or any platform supported by Power Automate.
From a high level, the flow works as shown in the image below.
The Full Flow
The full flow is automatically created by the Convert Email to PDF and archive in Dropbox flow template. After selecting the template, make sure the following fields are changed:
- Dropbox Output folder (for HTML emails) — The Dropbox folder to save the PDF files to.
- Dropbox Output folder (for text emails) — The Dropbox folder to save the PDF files to.
The flow itself is relatively straightforward. First, you'll need to ensure the format of the email. It may appear to be in a simple format, but content can be represented in HTML format, plain text, or even RTF. Depending on the format, it's necessary to send the body either to the HTML converter or the text converter.
This flow can check if <html
, <p
, or <br
are found in the email body. If they are, it's sent to the HTML converter. If they aren't, it's sent to the text converter.
For more details about using Muhimbi’s flow actions, refer to the core concepts knowledge base article, as well as all other flow-related guides.
Troubleshooting/Caveats
HTML isn’t the best format for print or PDF conversion purposes. Depending on your exact needs and source material, you may need to experiment with various available settings. If you have any questions or require assistance, please feel free to contact us.
Please consider the following when using Power Automate:
Modern views — In SharePoint Online, it’s possible to display lists and libraries in modern or classic mode. Modern view is undergoing constant change (by Microsoft), and some modern view pages will convert fine, while others don’t. As a result, we currently only support the conversion of pages displayed in classic view.
Multi-factor authentication (MFA) — An increasing number of SharePoint Online/Office 365 environments are secured using MFA. Although this is a positive development, it gets in the way of automated systems, including our HTML converter. If your environment uses MFA, create an app password for HTML conversions, or disable MFA on your HTML conversion account.
HTML conversion option isn’t displayed — The option to convert the current page to PDF is only available in classic SharePoint pages. Modern pages currently don’t provide the ability to extend the personal actions menu. As soon as Microsoft makes this functionality available, we’ll add it.
PDF layout doesn’t match — By default, the page being converted is optimized for print/PDF output. If you prefer for a PDF to look exactly like what’s displayed onscreen, including user interface elements, set the Media Type to Screen in the HTML conversion configuration screen.
User-modified content isn’t converted — The converter doesn’t have knowledge about the information currently displayed in the user’s browser (e.g. size of the browser window, or custom data entered but not yet submitted to the server). The converter always requests a fresh copy of the URL and converts that information to PDF.
User-specific information is missing — HTML conversion is carried out in the context of the configured user account, though the system isn’t aware of the user carrying out the HTML conversion. Don’t specify accounts that display more information than what users need to have access to.
Additional Resources
For more information, refer to the following resources.