Magefan generates and attaches PDF files to sales emails — orders, invoices, shipments, credit memos — automatically, directly from the admin, with the option to add terms and conditions along with 4 additional PDF files to each transactional email.
This guide explains how to attach PDF files to sales emails in Magento and how to test the file attachments.
Installation & updates
To install Email Attachments for Magento 2, navigate to your Magefan account > Downloads > Install via Composer to get Composer installation commands. Then just follow the instructions from the Magefan extensions management guide.
Once you install the extension, go to Stores > Configuration > Magefan Extensions > Email Attachments to enable and configure the extension.
General settings
The configuration is organised in a way that gives you granular control over attachments for each transactional email type — Order, Invoice, Shipment, and Credit Memo. All emails share the same set of options.
Emails
- Attach PDF — attaches a PDF file of a corresponding document to that email.
Note: Magefan Email Attachments generates PDF files on the fly when a transactional email is being sent to reflect current order information.
- Attach Terms and Conditions PDF — attaches the uploaded Terms and Conditions file (see Terms and Conditions File below) to that email, along with other order documents enabled for that email.
- Attach Additional File 1 through 4 — attaches any of the 4 custom files (see Additional Files below) to that email.
![]()
Pro tip: enable only those files that are specific to that email type since each attachment adds to the email size and can trigger spam filters if there are too many attachments. For example, add Return Shipping Label to Shipment emails, not to Order emails.
Terms and conditions file
Here you upload your privacy policy file, which you can then attach to every transactional email above.
![]()
Additional files
Here is a per-email section that allows you to upload PDF files to send along with other transaction docs above.
![]()
Here are some ideas for those 4 email attachments:
- Product care document or a warranty
- Product guide or user manual
- Loyalty or rewards program overview
- Return shipping label or return guide
Multi-store support
Every option in the email file sections is scoped per store view. This means you can upload terms and conditions/additional 4 files for every store view and attach corresponding sales email PDF files for each store or store view.
e.g. you can attach translated product guides or terms and conditions for each language on top of the store-based files the system generates and attaches automatically.
Testing
Once you configure the extension, check how the attachments are working. Place a test order on your frontend and check the Magento order confirmation email with the expected PDF files attached. Then continue going through the order processing and check each email that arrives for invoice, shipment and credit memo.
![]()
Open each generated PDF and any additional PDFs, and confirm they are rendered correctly and reflect the order data as expected.
![]()
Note: for multi-language stores, test email attachments on multiple store views, especially if you've assigned different language variants of a PDF file to different store views.