magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.37k stars 9.28k forks source link

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

Open dudzio12 opened 3 years ago

dudzio12 commented 3 years ago

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.

m2-assistant[bot] commented 3 years ago

Hi @dudzio12. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

t-heuser commented 2 years ago

I'd love to see this feature and not have to implement it by myself!

cavalier79 commented 1 year ago

Please add this feature

DenisMir commented 4 months ago

WTF Add this basic feature...

ImanuelBertrand commented 1 month ago

The PR to implement this (that looks to have been completed) has been closed for being backwards incompatible while I don't think it actually is BIC. I've asked for clarification in the PR but I'm not sure there will be an answer in a closed PR.