magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Allow to add file attachments to email transport with TransportBuilder

Open dudzio12 opened this issue 3 years ago • 4 comments

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.

dudzio12 avatar Jun 16 '21 15:06 dudzio12

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

: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

m2-assistant[bot] avatar Jun 16 '21 15:06 m2-assistant[bot]

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

t-heuser avatar Oct 21 '21 12:10 t-heuser

Please add this feature

cavalier79 avatar Dec 01 '22 09:12 cavalier79

WTF Add this basic feature...

DenisMir avatar Feb 22 '24 15:02 DenisMir

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.

ImanuelBertrand avatar May 25 '24 11:05 ImanuelBertrand