From fa8cbd08d4cd5e51ad93f34f7ae59ed27a5043b6 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 18 Oct 2012 17:15:06 +0000 Subject: [PATCH] Internal: you can add 'attachments' => array of ormDocument to the context of a trigger, the attachments will be added to the email sent SVN:trunk[2291] --- core/action.class.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/action.class.inc.php b/core/action.class.inc.php index 832f3b9d1..4fccf6fa9 100644 --- a/core/action.class.inc.php +++ b/core/action.class.inc.php @@ -356,6 +356,14 @@ class ActionEmail extends ActionNotification $oEmail->SetMessageId($sMessageId); } + if (isset($aContextArgs['attachments'])) + { + foreach($aContextArgs['attachments'] as $oDocument) + { + $oEmail->AddAttachment($oDocument->GetData(), $oDocument->GetFileName(), $oDocument->GetMimeType()); + } + } + if (empty($this->m_aMailErrors)) { if ($this->m_iRecipients == 0)