Skip to content

Allow to add file attachments to email transport with TransportBuilder #33261

Open
@dudzio12

Description

@dudzio12

Description (*)

There is no good way to add email attachment in Magento 2.2 onwards. There are tons of multiple code gists and micro modules that implement that feature. The worst part is that it's always same code over and over with the usage of preference to rewrite core TransportBuilder class. That feature should have been implemented years ago, but better late than never. :)

Expected behavior (*)

Possibility to use addAttachment method on TransportBuilder which will allow to send email messages with one or multiple attachments.

Benefits

There will be no need to implement that feature over and over on project level.

Additional information

The core functionality will only allow developers to use addAttachment method and it won't be used by any Magento Core class, but it might change over time. For developers - it will make adding attachment's much easier, since it will be possible to add attachment with single module using plugins or single preference for specific Sender class and not preference on such frequently used class as TransportBuilder. I'll create PR just after adding this request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions