When it comes to merging emails the process involves combining the content of multiple emails into a single cohesive document. By utilizing PDF.co and Make, you can set up a workflow that triggers when new emails are received. This can be achieved using the Mailhook module, which allows you to capture email data and attachments.

With PDF.co’s API, you can convert email attachments, which may be in various file formats, to PDF. Then, the converted PDF attachments can be merged with the email content, resulting in a consolidated PDF document. The merged PDF document can be saved to a desired location, sent via email, or integrated into other applications or systems as needed.

In this guide, we will explore how to merge emails using PDF.co and Make. By following the steps outlined below, you can automate the process of merging email content and attachments into a single, cohesive PDF document.

  1. Create a New Scenario
  2. Add Webhooks Module
  3. Create Webhooks Mailhook
  4. Add Iterator Tools
  5. Iterator Flow Control
  6. Add PDF.co Upload File Module
  7. PDF.co Connection and Configuration
  8. Add Text Aggregator Tools
  9. Setup Text Aggregator
  10. Add PDF.co Convert HTML to PDF Module
  11. Setup Convert HTML to PDF
  12. Add PDF.co Merge a PDF Module
  13. Setup Merge a PDF
  14. Run Scenario Result
  15. Merge PDF Output
  16. Demo

Here is a comprehensive tutorial that provides a step-by-step explanation of how to merge email content and its attachments received through Mailhook using PDF.co and Make. In this example guide, we will utilize different file types for the attachments, including PDFs, ZIP archives containing images, and Word documents.

Step 1: Create a New Scenario

  • Let’s begin by opening your Make account and creating a new scenario.

Step 2: Add Webhooks Module

  • To proceed, you need to search and locate the Webhooks application. Once found, select the Custom mailhook option, which is specifically designed to trigger actions when data is received by Mailhook.

Add Webhooks Module

Step 3: Create Webhooks Mailhook

  • Next, let’s proceed with creating a Webhooks mailhook to receive an email.

Create Webhooks Mailhook

Step 4: Add Iterator Tools

  • In this step, we will integrate Iterator tools, allowing us to access the details of all files and perform operations on each file as a complete record.

Add Iterator Tools

Step 5: Iterator Flow Control

  • Within the Array section of Flow Control, locate the Attachments array which contains the files attached to an email.

Iterator Flow Control

Step 6: Add PDF.co Upload a File

  • In this step, we will incorporate the PDF.co application and select the Upload a File functionality to transfer the attachment files to temporary storage, which will be utilized in PDF.co processing.

Add PDF.co Upload a File

Step 7: PDF.co Connection and Configuration

  • Let’s connect the PDF.co account to Make by adding the API Key. You can obtain the API Key from your PDF.co dashboard or by signing up at this link.
  • For the File field, select the Flow Control-Iterator.

 PDF.co Connection and Configuration

Step 8: Add Text Aggregator Tools

  • In this step, we will add the Tools module and select the Text aggregator option to combine multiple strings into a single text.

Add Text Aggregator Tools

Step 9: Setup Text Aggregator

Let’s set up the configuration:

  • First, enable the option to show advanced settings.
  • In the Source Module field, choose the Iterator.
  • In the Row Separator field, select the Other option.
  • Then, input a comma in the Separator field to separate the URLs.
  • For the Text field, select the URL from PDF.co – Upload a File.

Setup Text Aggregator

Step 10: Add PDF.co Convert HTML to PDF Module

  • In this step, we will incorporate the PDF.co application and select the functionality to convert HTML to PDF. By utilizing this tool, we will be able to transform the content of the email into a PDF file.

Add PDF.co Convert HTML to PDF Module

Step 11: Setup Convert HTML to PDF

Let’s configure the Convert HTML to PDF settings:

  • First, choose the HTML to PDF feature in the Convert type field.
  • Next, for the Input HTML Code field, input the HTML content obtained from Mailhook.

Setup Convert HTML to PDF

Step 12: Add PDF.co Merge a PDF Module

  • In this next step, we will integrate the PDF.co application and choose the Merge a PDF feature. This capability allows us to convert various attachment files into PDF format.

Add PDF.co Merge a PDF Module

Step 13: Setup Merge a PDF

Let’s set up the Merge a PDF configuration.

  • To enable non-PDF files as input, check the Yes option in the corresponding field. This will allow us to merge non-PDF files into a PDF.
  • For the Input Type field, choose the Input Link(s) option. This will enable us to merge files using their respective links.
  • In the Input Link field, enter the resulting URL from the HTML to PDF operation. Additionally, include the text that contains the uploaded files from the Text Aggregator.
  • Lastly, provide a desired name for the output of the merged PDF in the Output File Name field. This name will be assigned to the final PDF file generated after the merging process.

 Setup Merge a PDF

Once you have finished configuring the workflow, let’s proceed to run the scenario. When the scenario is activated, every time an email is sent to Mailhook, it will automatically merge the content of the email and the attachment files into a single PDF document.

Step 14: Run Scenario Result

  • The scenario has been successfully executed and processed our request. To view the output, please copy the provided URL and paste it into your web browser. By doing so, you will be able to access and view the resulting PDF document.

 Run Scenario Result

Step 15: Merge PDF Output

  • Here is the merged PDF document that combines the email content and attachment files sent to Mailhook.
Merge PDF Output
Merge PDF Output

Step 16: Demo

  • Take a look at this demonstration showcasing how the workflow is processed.
Workflow Demo

In this guide, you have acquired knowledge on how to combine email content and different attachments sent to Mailhook using PDF.co and Make. You have learned the process of converting email content into a PDF format utilizing the HTML to PDF functionality of PDF.co. Additionally, you have gained an understanding of merging multiple files into a unified PDF document.