How to Create PDF from Email Using Power Automate
How to Create PDF from Email Using Power Automate
Organizations often need to archive important emails for auditing, compliance, legal requirements, and document management. Manually saving emails as PDF files can be time-consuming and prone to errors.
Using Power Automate, you can automatically convert Outlook emails into PDF documents and store them in SharePoint, OneDrive, or other document repositories.
Business Scenario
Suppose your customer support team receives hundreds of emails every day. Instead of manually saving each email, Power Automate can automatically create PDF files and store them in a SharePoint document library for future reference.
Step 1: Create Automated Cloud Flow
- Open Power Automate.
- Click Create.
- Select Automated Cloud Flow.
- Choose "When a new email arrives (V3)" trigger.
- Configure Outlook settings.
Step 2: Create HTML Content
<html>
<body>
<h2>Email Details</h2>
<b>From:</b>
@{triggerOutputs()?['body/from']}
<br><br>
<b>Subject:</b>
@{triggerOutputs()?['body/subject']}
<br><br>
<b>Received:</b>
@{triggerOutputs()?['body/receivedDateTime']}
<br><br>
@{triggerOutputs()?['body/body']}
</body>
</html>
Step 3: Create HTML File
File Name:
Email_@{formatDateTime(
utcNow(),
'yyyyMMddHHmmss'
)}.html
Store the HTML content temporarily in OneDrive or SharePoint.
Step 4: Convert HTML to PDF
Convert File Source: HTML File Target: PDF
Use OneDrive for Business Convert File action or third-party PDF connectors.
Step 5: Save PDF File
File Name:
@{replace(
triggerOutputs()?['body/subject'],
'/',
'-'
)}
_@{formatDateTime(
utcNow(),
'yyyyMMddHHmmss'
)}.pdf
Save the generated PDF file into SharePoint, OneDrive, or another storage location.
Flow Design
When New Email Arrives
↓
Create HTML Content
↓
Create HTML File
↓
Convert File to PDF
↓
Create PDF File
↓
Store in SharePoint
Common Use Cases
- Email Archiving
- Customer Support Documentation
- Legal Compliance Records
- Invoice Storage
- Contract Communications
- Audit Trail Management
Benefits
- Automates document creation
- Improves compliance management
- Reduces manual effort
- Centralizes email storage
- Enhances document accessibility
Key Takeaways
- Power Automate can automatically convert emails into PDF files.
- Outlook emails can be archived without manual intervention.
- PDFs can be stored in SharePoint or OneDrive.
- Automated archiving improves compliance and auditing.
- Email-to-PDF conversion is ideal for enterprise document management.