3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
11 namespace Civi\FlexMailer\Listener
;
13 use Civi\FlexMailer\Event\ComposeBatchEvent
;
15 class Attachments
extends BaseListener
{
18 * Add any attachments.
20 * @param \Civi\FlexMailer\Event\ComposeBatchEvent $e
22 public function onCompose(ComposeBatchEvent
$e) {
23 if (!$this->isActive()) {
27 foreach ($e->getTasks() as $task) {
28 /** @var \Civi\FlexMailer\FlexMailerTask $task */
29 $task->setMailParam('attachments', $e->getAttachments());