Pimcore\Mail::disableLogging PHP Метод

disableLogging() публичный Метод

Disables email logging
public disableLogging ( ) : Mail
Результат Mail Provides fluent interface
    public function disableLogging()
    {
        $this->loggingEnable = false;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * 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();
         $mail->disableLogging();
         $mail->setIgnoreDebugMode(true);
         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(["success" => $success]);
 }