diff --git a/dev/LogEmailWriter.php b/dev/LogEmailWriter.php index 9f1a29ac5..a383c77c3 100644 --- a/dev/LogEmailWriter.php +++ b/dev/LogEmailWriter.php @@ -12,6 +12,11 @@ require_once 'Zend/Log/Writer/Abstract.php'; */ class SS_LogEmailWriter extends Zend_Log_Writer_Abstract { + /** + * @var $send_from Email address to send log information from + */ + protected static $send_from = 'errors@silverstripe.com'; + protected $emailAddress; protected $customSmtpServer; @@ -21,6 +26,14 @@ class SS_LogEmailWriter extends Zend_Log_Writer_Abstract { $this->customSmtpServer = $customSmtpServer; } + public static function set_send_from($address) { + self::$send_from = $address; + } + + public static function get_send_from() { + return self::$send_from; + } + /** * Send an email to the email address set in * this writer. @@ -40,7 +53,12 @@ class SS_LogEmailWriter extends Zend_Log_Writer_Abstract { // override the SMTP server with a custom one if required if($this->customSmtpServer) ini_set('SMTP', $this->customSmtpServer); - mail($this->emailAddress, $subject, $data, "Content-type: text/html\nFrom: errors@silverstripe.com"); + mail( + $this->emailAddress, + $subject, + $data, + "Content-type: text/html\nFrom: " . self::$send_from + ); // reset the SMTP server to the original if($this->customSmtpServer) ini_set('SMTP', $originalSMTP);