# fooman/emailattachments-implementation-m2

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

`composer require fooman/emailattachments-implementation-m2`

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

## At a glance

- **Vendor**: fooman (https://packagento.com/fooman.md)
- **Latest version**: 107.6.0 — released 2026-04-02
- **Pricing**: Free
- **Package type**: Magento 2 module
- **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-implementation-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-implementation-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.

## Changelog

### [107.6.0] - 2026-04-02
#### 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

### [107.5.3] - 2025-09-16
#### Changed
- Allow mailpit url override via environment variable in tests

### [107.5.2] - 2025-04-10
#### Fixed
- Adjust test output for mailpit response 

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

### [107.5.0] - 2025-03-04
#### Added
- Support for Magento 2.4.8
- Support for Php 8.4

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

### [107.3.0] - 2023-02-07
#### Added
- Support for Php 8.2

### [107.2.1] - 2022-01-30
#### Added
- Support for PHP 8.0 and 8.1

### [107.2.0] - 2021-09-08
#### Changed
- Switch to Laminas Mime package, minimum Magento version is now 2.3.5

### [107.1.1] - 2020-12-10
#### Fixed
- Don't send the same named attachment twice

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

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

### [107.0.0] - 2020-01-21
#### Added
- Ability to attach invoices to the shipping confirmation email
#### Changed
- Model\Api\PdfRendererInterface getFileName method signature changed
- Updated comments for latest Magento Coding Standards

### [106.0.0] - 2019-10-04
#### Changed
- Adjustments for new email handling in Magento 2.3.3
  Removed Plugin\TransportFactory with most functionality now handled by Plugin\MimeMessageFactory,
  Method signature changes for Model\EmailEventDispatcher
- Use previous releases for earlier versions of Magento
- Removed support for Php 7.0

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

### [105.1.0] - 2019-06-26
#### Added
- AttachmentInterface::getFilename(true) now provides the base64 encoded name of the attachment
- PHPStan to development tools
#### Fixed
- Some parameter type issues

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

### [105.0.7] - 2019-04-19
#### Fixed
- MFTF tweak if not run in isolation

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

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

### [105.0.4] - 2019-03-27
#### Added
- Compatibility with Magento 2.2.8

### [105.0.3] - 2019-03-27
#### Added
- Initial MFTF acceptance test

### [105.0.2] - 2018-12-11
#### Changed
- Reverse 7.1 features as Magento Marketplace does not yet support it

### [105.0.1] - 2018-11-27
#### Changed
- Use newer php features (minimum 7.1)

### [105.0.0] - 2018-11-26
#### Changed
- Add compatibility with Magento 2.3.0 and handle upgrade of Zend_Mail, for earlier versions of Magento use
previous versions
Constructor change in Model\EmailEventDispatcher
- explicitly state Zend\Mime dependency

### [104.0.4] - 2018-09-28
#### Added
- Ability to customise affect the final filename

### [104.0.3] - 2018-07-23
#### Changed
- Reorganised unit tests

### [104.0.2] - 2018-07-15
#### Changed
- Code Quality improvement - use class constants

### [104.0.1] - 2018-07-10
#### Changed
- Fixed integration tests

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

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

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

## Recent Versions

| Version | Released |
|---|---|
| 107.6.0 | 2026-04-02 |
| 107.5.3 | 2025-09-16 |
| 107.5.2 | 2025-04-10 |
| 107.5.1 | 2025-04-10 |
| 107.5.0 | 2025-03-04 |
| 107.4.0 | 2024-03-18 |
| 107.3.0 | 2023-02-07 |
| 107.2.1 | 2022-01-30 |
| 107.2.0 | 2021-09-08 |
| 107.1.1 | 2020-12-10 |

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

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^103.0.4-p13 |
| magento/module-backend | ^102.0.4-p12 |
| magento/module-checkout-agreements | ^100.4.3-p7 |
| magento/module-email | ^101.1.4-p12 |
| magento/module-sales | ^103.0.4-p13 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0\|\|~8.5.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| fooman/testing-and-quality-tools | ^1.5.4 |

### 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 (107.6.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 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### 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 | Warning | 28 | 28 warnings (ruleset: Magento2) — 3 auto-fixable with phpcbf |
| PHPMD | Warning | 7 | 7 rule violations (UnusedPrivateMethod:4, UnusedFormalParameter:3) |
| Cpd | Warning | 3 | 3 duplicated chunks spanning 188 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (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 | N/A | 0 | no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1 |
| Malware scan | Pass | 0 |  |

## 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-implementation-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.

