Internal: Allow to attach file in mail from stream - refs BT#21648

pull/5544/head
Angel Fernando Quiroz Campos 6 months ago
parent b8a3a9f8fb
commit faf578c661
  1. 5
      src/CoreBundle/ServiceHelper/MailHelper.php

@ -12,6 +12,7 @@ use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\BodyRendererInterface;
use Symfony\Component\Mime\Part\DataPart;
final class MailHelper
{
@ -77,6 +78,10 @@ final class MailHelper
if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
$templatedEmail->attachFromPath($file_attach['path'], $file_attach['filename']);
}
if (!empty($file_attach['stream']) && !empty($file_attach['filename'])) {
$templatedEmail->addPart(new DataPart($file_attach['stream'], $file_attach['filename']));
}
}
}

Loading…
Cancel
Save