Bladeren bron

Internal: you can add 'attachments' => array of ormDocument to the context of a trigger, the attachments will be added to the email sent

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2291 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 jaren geleden
bovenliggende
commit
179cd9ef20
1 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 8 0
      core/action.class.inc.php

+ 8 - 0
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)