Changeset 628


Ignore:
Timestamp:
May 13, 2018 3:07:38 PM (6 years ago)
Author:
anonymous
Message:

Add Email::SANDBOX_MODE_LOG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r622 r628  
    8787    const SANDBOX_MODE_REDIRECT = 1; // Send all mail to 'sandbox_to_addr'
    8888    const SANDBOX_MODE_STDERR = 2; // Log all mail to stderr
     89    const SANDBOX_MODE_LOG = 3; // Log all mail using $app->logMsg(
)
    8990
    9091    /**
     
    412413            file_put_contents('php://stderr', sprintf("Subject: %s\nTo: %s\n%s\n\n%s", $this->getParam('subject'), $final_to, str_replace($this->getParam('crlf'), "\n", $final_headers), $final_body), FILE_APPEND);
    413414            return true;
     415
     416        case self::SANDBOX_MODE_LOG:
     417            $log_serialize = $app->getParam('log_serialize');
     418            $app->setParam(array('log_serialize' => false));
     419            $app->logMsg(sprintf("\nSubject: %s\nTo: %s\n%s\n\n%s", $this->getParam('subject'), $final_to, str_replace($this->getParam('crlf'), "\n", $final_headers), $final_body), LOG_DEBUG, __FILE__, __LINE__);
     420            $app->setParam(array('log_serialize' => $log_serialize));
     421            return true;
    414422        }
    415423
Note: See TracChangeset for help on using the changeset viewer.