aimanecouissi / module-mail-transport-builder-attachment
Add attachments to Magento mail transport
Package info
github.com/aimanecouissi/magento2-module-mail-transport-builder-attachment
Type:magento2-module
pkg:composer/aimanecouissi/module-mail-transport-builder-attachment
Requires
- php: ^8.3
- ext-fileinfo: *
- magento/framework: ^103.0.8
README
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.