The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Actively Maintained v1.0.0

Mail Transport Builder Attachment for Magento 2

aimanecouissi/module-mail-transport-builder-attachment

Extends Magento's mail transport builder with email attachment support, providing an attachment-capable interface for adding raw content or file-based attachments to messages before they are sent.

1
Downloads
Below average
1
GitHub Stars
Below average
2mo ago
Last Release
0
Open Issues
Build Issues
2/3 checks passed

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
16 warnings
PHPStan Failed

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.0.0 on Magento 2.4.9
Jun 1, 2026

Looking for Contributors

Dependency injection compilation fails. Your contribution could help the entire Magento community!

Contribute

Share This Module's Status

Mail Transport Builder Attachment for Magento 2 Magento compatibility status badge

README

Loaded from GitHub

AimaneCouissi_MailTransportBuilderAttachment

Extends Magento's mail transport builder with email attachment support. The module provides an attachment-capable transport builder interface for adding raw content or file-based attachments before a message is sent.

Installation

composer require aimanecouissi/module-mail-transport-builder-attachment
bin/magento module:enable AimaneCouissi_MailTransportBuilderAttachment
bin/magento setup:upgrade
bin/magento cache:flush

Usage

Inject AttachmentTransportBuilderInterface where a Magento mail transport builder is needed. Use addAttachment() for raw content and addAttachmentFromFile() for readable file paths.

Call the attachment methods before getTransport(). Queued attachments are added to the generated MIME message and cleared when the builder resets after transport creation.

Uninstall

bin/magento module:disable AimaneCouissi_MailTransportBuilderAttachment
composer remove aimanecouissi/module-mail-transport-builder-attachment
bin/magento setup:upgrade
bin/magento cache:flush

Changelog

See CHANGELOG for all recent changes.

License

MIT

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.