/** * @param \Zend_Mail $tempfile * @param \Zend_Mail $mail * @param \Zend_Layout $layout */ public function __construct($tempfile, \Zend_Mail $mail, \Zend_Layout $layout = null) { $this->_tempfile = $tempfile; $writerFile = new \Zend_Log_Writer_Stream($tempfile); $this->_tempLogger = new \Zend_Log($writerFile); parent::__construct($mail, $layout); }
/** * Build a log writer which write to the provided email addresses * * @param array $options an array of options for the log writer, * allowed values are (with their default value) * - addresses: string or array of email addresses (required) * - sender: email address for the from header * (default: null {@see Zend_Mail::setDefaultFrom}) * - priority: a priority filter, (default = Zend_Log::ERR) * - project: an identifier for the current project (default = null) * - subject: a string automatically prepended to subject * (default = 'Errors in project $name') * {@see Zend_Log_Writer_Mail::setSubjectPrependText} */ public function __construct(array $options = array()) { // parse options $this->setOptions($options); // build a new mail object $mail = new Zend_Mail('utf-8'); if (isset($this->_options['sender'])) { $mail->setFrom($this->_options['sender']); } if (is_string($this->_options['addresses'])) { $mail->addTo($this->_options['addresses']); } else { foreach ($this->_options['addresses'] as $email) { $mail->addTo($email); } } parent::__construct($mail, $this->getLayout()); $this->setLayoutFormatter(new Zle_Log_Formatter_Table()); $this->setSubjectPrependText($this->_options['subject']); $this->addFilter($this->_options['priority']); }
/** * Instantiate the mail object * * @param string $filename Filename */ public function __construct($filename) { parent::__construct($this->getMail()); }