Problem/Motivation

Symfony mailer supports embedding images and file attachements (https://symfony.com/doc/5.4/mailer.html#embedding-images / https://symfony.com/doc/5.4/mailer.html#file-attachments). At the moment this has not yet been implemented (as noted in https://www.drupal.org/docs/contributed-modules/symfony-mailer-0/feature...), and the related methods are commented in Drupal\symfony_mailer\BaseEmailTrait.

I didn't see any issue for this yet, so here it is. Is there already a plan to implement this?

Proposed resolution

To be determined.

Remaining tasks

Implement support for:

  • attach()
  • attachFromPath()
  • embed()
  • embedFromPath()
  • attachPart()
  • getAttachments()

User interface changes

To be determined.

API changes

To be determined.

Data model changes

To be determined.

Comments

seanB created an issue. See original summary.

drcolossos’s picture

Since I already needed attaching files from a path, I simply uncommented the attach() function from the BaseEmailInterface and implemented it via BaseEmailTrait by directing the attach() call to $this->inner->attach(). Works without a probem (ignoring the permissions stuff etc since it is not needed)

adamps’s picture

Thanks, good to have an issue for this. There is a patch equal to #2 on #3261807: [META] Attachments support. However it cannot be committed until the security is done, and that's quite hard. I would also like to test out some different use cases (see "features and status" linked from the IS for some ideas) to confirm the interface is right before commit. In fact I would even say we should have tests for these different use cases - which means we would need to create the testing framework first.

In my mind this is not the top priority for me to spend time on as it seems quite specialised/complex and many of the basics are also still not present. Anyone who is keen to use it earlier can apply the linked patch.

seanb’s picture

Status: Active » Closed (duplicate)

Let's close this as a duplicate since the other issue has a patch. We'll focus our efforts there.