Skip to main content

One post tagged with "email automation"

View All Tags

Convert the Email Body and Every Attachment into One Consolidated PDF in Power Automate: A 7-Step Outlook + PDF4me Workflow

· 25 min read
SEO and Content Writer

The painful part of email-driven workflows is not the email, it is everything that comes with it. The body holds the context (who sent it, why, what to do), the attachments hold the artefacts (the invoice, the form, the signed contract), and storing them separately means future-you needs three clicks to reconstruct the message later. This walkthrough builds the exact pattern in Power Automate with PDF4me Convert to PDF, PDF4me Merge multiple PDF files, Outlook, Dropbox, and a single Apply to each loop. Seven flow actions. One incoming email lands. One consolidated PDF goes out, body first then attachment by attachment, timestamped and dropped into your archive folder automatically.

The flow at a glance
1. When a new email arrives (V3)
Outlook trigger on To [email protected]. Include Attachments Yes, Only with Attachments Yes.
2. Initialize variable
Name email, Type Array. Buffer for every PDF binary the flow produces.
3. Convert to PDF Body
PDF4me action. Content triggerOutputs body/body (the HTML body), File Name email-body.html. Returns the body as PDF.
4. Append to array (email body)
Push base64ToBinary on the converted body PDF onto the email array. This is page 1 of the final document.
5. Apply to each attachment
Loop triggerOutputs body/attachments. Convert each to PDF, then Append to array with base64ToBinary.
6. Merge multiple PDFs
PDF4me action. Body/docContent the email array, Output File Name Email Attachment Merge Output.pdf.
7. Create file
Dropbox /blog data/merge blog template/output. File Name concat(merge-, formatDateTime(utcNow(), yyyyMMdd-HHmmss), .pdf).