Convert email message to PDF in Power Automate

This article demonstrates how to convert an email message to PDF with the help of Power Automate (Microsoft Flow).

We will take a hiring contract text as a body of our message:

Email example

You can use different Power Automate (Microsoft Flow) connectors to receive messages. Some examples:

  • Office 365 Outlook


  • Gmail

In this example, we will convert email messages to PDF when they arrive in Office 365 Outlook inbox. Then we will store PDF files to a SharePoint document library. You can configure your Flow to store documents in any other location. For example, in Dropbox.

Setting up the Flow

This is what the complete flow should look like:

Convert Email to PDF Flow

Flow trigger

Choosing a trigger is up to you. For our scenario, we will use the Office 365 Outlook trigger called When a new email arrives:

When a new email arrives

Convert HTML to PDF

This is an action from the Plumsail Documents connector.

Add convert HTML to PDF action

If this is your first time using the Plumsail Documents connector, Power Automate will request the Connection Name and API Key.

Create connection in Power Automate flow

You can type any name for the connection, for example Plumsail Documents.

Once the connection name is filled out, create an API key in your Plumsail Account, copy and paste it into the Access Key field, and then click Create.

Copying an API key from the account

Just put the body variable from trigger output into the Source HTML parameter of the action. We’ll use email subject as the file name:

Convert HTML to PDF

Then you can receive PDF file content as an output of the action.

You can find more information about this action here.

Create PDF file

Now you need to store PDF file somewhere. In our example, we use Create file action from SharePoint connector to store the PDF document into SharePoint document library:

Convert Email to PDF Flow - Create file

You can use any other connector to store PDF document into your system.