/** * Add all Users to mail * * TODO: Use Users from Pimcore * * @param Mail $mail */ public static function addAdminToMail(Mail $mail) { $mail->addBcc("*****@*****.**"); }
/** * Resends the email to the recipients */ public function resendEmailAction() { if (!$this->getUser()->isAllowed("emails")) { throw new \Exception("Permission denied, user needs 'emails' permission."); } $success = false; $emailLog = Tool\Email\Log::getById($this->getParam('id')); if ($emailLog instanceof Tool\Email\Log) { $mail = new Mail(); $mail->preventDebugInformationAppending(); if ($html = $emailLog->getHtmlLog()) { $mail->setBodyHtml($html); } if ($text = $emailLog->getTextLog()) { $mail->setBodyText($text); } $mail->setFrom($emailLog->getFrom()); foreach ($emailLog->getToAsArray() as $entry) { $mail->addTo($entry['email'], $entry['name']); } foreach ($emailLog->getCcAsArray() as $entry) { $mail->addCc($entry['email'], $entry['name']); } foreach ($emailLog->getBccAsArray() as $entry) { $mail->addBcc($entry['email']); } $mail->setSubject($emailLog->getSubject()); $mail->send(); $success = true; } $this->_helper->json(array("success" => $success)); }