# fooman/emailattachments-m2

> Automatically attach pdf and terms and conditions documents to outgoing sales emails.

`composer require fooman/emailattachments-m2`

Canonical URL: https://packagento.com/fooman/emailattachments-m2

## At a glance

- **Vendor**: fooman (https://packagento.com/fooman.md)
- **Latest version**: 3.7.0 — released 2026-04-20
- **Pricing**: Free
- **Package type**: Metapackage (bundle of modules)
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/fooman/emailattachments-m2 and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require fooman/emailattachments-m2:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Automatically attach pdf and terms and conditions documents to outgoing sales emails.

## README

### Extension for Magento 2

A User Manual can be found [here](https://magento2-support.fooman.co.nz/collection/1001-email-attachments-magento-2)

### Installation

This package is available via packagist.org. Please use Composer to install the extension

```
bin/magento deploy:mode:set developer (if you are in production mode)
composer require fooman/emailattachments-m2:^3.0
bin/magento module:enable --clear-static-content Fooman_EmailAttachments
bin/magento setup:upgrade

your usual sequence of commands to enable production mode, for example
bin/magento deploy:mode:set production
```

### Depending on Email Attachments 
If you are using Email Attachments to build functionality on top of please require the implementation package
`composer require fooman/emailattachments-implementation-m2` instead as only that package will be semantically versioned.

## Changelog

### [3.7.0] - 2026-04-20
#### Added
- Support for Magento 2.4.9
- Support for Php 8.5
#### Changed
- Lowest supported versions are now Magento 2.4.4-p13 and php 8.1 - use previous versions for older Magento versions

### [3.6.1] - 2025-04-10
#### Fixed
- Rework extension to also support Symfony Mailer

### [3.6.0] - 2025-04-08
#### Added
- Support for Magento 2.4.8
- Support for Php 8.4

### [3.5.0] - 2024-03-26
#### Added
- Support for Php 8.3
#### Changed
- Code style updates for newer Magento Coding Standard

### [3.4.0] - 2023-03-06
#### Added
- Support for Php 8.2
- Support for Magento 2.4.6

### [3.3.11] - 2022-08-03
#### Added
- Support for Magento 2.4.5

### [3.3.10] - 2022-03-29
#### Added
- Support for Magento 2.4.4
- Support for Php 8.0/8.1

### [3.3.9] - 2021-09-08
#### Changed
- Switch to Laminas Mime package, minimum Magento version is now 2.3.5
#### Fixed
- Don't send the same named attachment twice

### [3.3.8] - 2021-07-30
#### Added
- Support for Magento 2.4.3

### [3.3.7] - 2021-04-30
#### Added
- Support for Magento 2.3.7

### [3.3.6] - 2021-02-02
#### Added
- Support for Magento 2.4.2

### [3.3.5] - 2020-10-02
#### Added
- Support for Magento 2.3.6 and 2.4.1

### [3.3.4] - 2020-07-28
#### Added
- Support for PHP 7.4
- Support for Magento 2.4.0
#### Fixed
- Mislabeled admin setting

### [3.3.3] - 2020-05-02
#### Fixed
- Reworked email identification to strictly cover supported types only

### [3.3.2] - 2020-04-22
#### Added
- Support for Magento 2.3.5

### [3.3.1] - 2020-01-24
#### Added
- Support for Magento 2.3.4

### [3.3.0] - 2020-01-21
#### Added
- Ability to attach invoices to the shipping confirmation email
#### Changed
- Updated comments for latest Magento Coding Standards

### [3.2.0] - 2019-10-05
#### Changed
- Refactor for new email handling in Magento 2.3.3
- Use previous releases for earlier versions of Magento
- Removed support for Php 7.0

### [3.1.9] - 2019-10-03
#### Added
- Support for Magento 2.3.2-p1

### [3.1.8] - 2019-08-16
#### Changed
- Adjust for changed core behaviour around plain text emails

### [3.1.7] - 2019-06-26
#### Added
- Support for Magento 2.3.2 and 2.2.9

### [3.1.6] - 2019-05-10
#### Changed
- Adopt latest Magento Coding Standards

### [3.1.5] - 2019-04-11
#### Fixed
- Reverse additional return types

### [3.1.4] - 2019-04-09
#### Fixed
- Reverse adding return types to maintain 2.2.8 compatibility

### [3.1.3] - 2019-03-28
#### Added
- Compatibility with Magento 2.2.8

### [3.1.2] - 2019-03-27
#### Added
- Compatibility with Magento 2.3.1
- Initial MFTF acceptance test

### [3.1.1] - 2019-01-04
#### Added
- Readme
#### Changed
- Reverse 7.1 features as Magento Marketplace does not yet support it

### [3.1.0] - 2018-11-28
#### Changed
- Add compatibility with Magento 2.3.0 and handle upgrade of Zend_Mail, for earlier versions of Magento use
previous versions
- Use newer php features (minimum 7.1)
#### Added
- Ability to customise affect the final filename

### [3.0.4] - 2018-11-06
#### Changed
- Reorganised unit tests

### [3.0.3] - 2018-07-20
#### Changed
- Code Quality improvement - use class constants
#### Fixed
- Failing integration test for replaced pdfs

### [3.0.2] - 2018-06-25
#### Changed
- Major rewrite - removed all preferences, use plugins on TransportBuilder and TransportFactory instead

### [3.0.1] - 2018-03-20
#### Changed
- Adjusted tests to provide for Pdf Customiser transforming T&Cs to Pdfs

### [3.0.0] - 2018-03-16
#### Changed
- Package changed into a Metapackage - Implementation moved into fooman/emailattachments-implementation-m2 package
- Semantic versioning will only be applied to the implementation package
- Attachments are also added to emails sent separately

### [2.1.0] - 2017-09-01
#### Added
- Support for PHP 7.1
- Support for Magento 2.2.0

### [2.0.8] - 2017-06-02
#### Fixed
- Make CheckoutAgreements dependency explicit

### [2.0.7] - 2017-02-28
#### Added
- Ability for integration test to check for attachment name

_(Changelog truncated for .md surface. Full history on https://packagento.com/fooman/emailattachments-m2.)_

## Recent Versions

| Version | Released |
|---|---|
| 3.7.0 | 2026-04-20 |
| 3.6.1 | 2025-04-10 |
| 3.6.0 | 2025-04-08 |
| 3.5.0 | 2024-03-26 |
| 3.4.0 | 2023-03-06 |
| 3.3.11 | 2022-08-03 |
| 3.3.10 | 2022-03-29 |
| 3.3.9 | 2021-09-08 |
| 3.3.8 | 2021-07-30 |
| 3.3.7 | 2021-04-30 |

Showing 10 of 45 versions. Full release history on https://packagento.com/fooman/emailattachments-m2.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| fooman/emailattachments-implementation-m2 | 107.6.0 |
| magento/framework | >=103.0.4-p13 < 103.0.10 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0\|\|~8.5.0 |

### Suggest

| Package | Constraint |
|---|---|
| fooman/pdfcustomiser-m2 | Allows to easily customise the sales pdfs while also reducing file sizes  |
| fooman/printorderpdf-m2 | Allows attaching the order confirmation pdf to the order confirmation email |

## Quality

Latest release (3.7.0) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | not tested | not tested | – | – |
| 2.4.8 | – | not tested | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | N/A | 0 | metapackage ships no source of its own — phpcs skipped (#122) |
| PHPMD | N/A | 0 | metapackage ships no source of its own — phpmd skipped (#122) |
| Cpd | N/A | 0 | metapackage ships no source of its own — cpd skipped (#122) |
| PHP Compatibility | N/A | 0 | metapackage ships no source of its own — php-compatibility skipped (#122) |
| Composer validate | Info | 2 | valid; 2 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 4 | 4 | – | – |
| 2.4.8 | – | 2 | 2 | – |
| 2.4.9 | – | – | 2 | 2 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | N/A | 0 | metapackage ships no source of its own — malware scan skipped (#122) |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["fooman/emailattachments-m2"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

fooman is a Magento 2 vendor on Packagento. See https://packagento.com/fooman.md for their full catalogue.

