Rendering Emails as PDFs in Salesforce Marketing Cloud
Converting Salesforce Marketing Cloud Engagement emails into PDFs can be a required step for documentation, compliance, and archiving. While Salesforce provides various solutions for PDF rendering, not all are fully compatible with Salesforce Marketing Cloud (SFMC). This insight explores different methods to convert emails into PDFs and automate the process wherever possible.
Manual PDF Rendering
For users who need a straightforward approach, saving an email as a PDF manually is an option:
- Open the email message.
- Click on the File tab and select Print.
- From the Printer drop-down, choose Microsoft Print to PDF.
- Click Print.
- In the Save Print Output As box, select a folder, enter a file name, and click Save.
Using Chrome Extensions
Several Chrome extensions can facilitate PDF conversion, including:
- Fireshot – A popular tool that captures entire webpages and saves them as PDFs.
Using Sejda for PDF Conversion
Sejda is a free online tool that preserves links and other embedded elements while converting emails to PDFs. It can be an excellent solution for one-off conversions where maintaining interactivity is important.
Email Archiving in Salesforce
Salesforce offers an Email Archiving Add-On that can store emails for compliance and retrieval. However, this solution is more focused on archiving than rendering emails into PDFs.
Automating PDF Rendering in SFMC
For those looking to automate PDF generation, a structured approach using AWS services and SFMC data extensions is possible.
Steps to Automate PDF Rendering
- Store the Web Version URL
- Each sent email has a View As Web Page (VAWP) link.
- Store this VAWP URL in Sendlog to retrieve the unique web version of the sent email.
- Create a Query-Based Automation
- Set up a Query Activity that runs periodically (e.g., hourly) to fetch unprocessed VAWP URLs from Sendlog.
- Store these entries in a separate Data Extension for processing.
- Set Up an AWS Lambda Function
- Deploy an AWS Lambda instance with an HTML rendering tool like wkhtmltopdf.
- Use an AWS S3 Bucket to store generated PDFs.
- This function should expose an endpoint to receive the VAWP URL and a unique identifier (which will be used as the filename).
- Implement Queueing with AWS SQS
- To prevent system overload, an AWS Simple Queue Service (SQS) can manage requests from SFMC to Lambda.
- Integrate SFMC with AWS Services
- Create a Script Activity using Server-Side JavaScript (SSJS) to:
- Fetch unprocessed records from the Data Extension.
- Send the VAWP URL and identifier to AWS SQS.
- Mark the record as processed in Sendlog.
- Create a Script Activity using Server-Side JavaScript (SSJS) to:
- PDF Storage and Access
- Once the rendering process is complete, wkhtmltopdf stores the output in AWS S3.
- Users can access the PDFs as needed.
Alternative AppExchange Solutions
For those looking for pre-built solutions, Salesforce AppExchange offers various options, such as Sercante, which specializes in PDF generation and marketing automation integrations.
Conclusion
Converting emails to PDFs in SFMC can be done manually, with browser extensions, or through automated solutions using AWS services. The right choice depends on your needs, whether it’s one-time conversion, compliance archiving, or a fully automated workflow.
Content updated February 2025.