예제 #1
0
파일: Mail.php 프로젝트: nicksagona/PopPHP
 /**
  * Method to write to the log
  *
  * @param  array $logEntry
  * @param  array $options
  * @return \Pop\Log\Writer\Mail
  */
 public function writeLog(array $logEntry, array $options = array())
 {
     $subject = isset($options['subject']) ? $options['subject'] : 'Log Entry:';
     $subject .= ' ' . $logEntry['name'] . ' (' . $logEntry['priority'] . ')';
     $mail = new \Pop\Mail\Mail($subject, $this->emails);
     if (isset($options['headers'])) {
         $mail->setHeaders($options['headers']);
     }
     $entry = implode("\t", $logEntry) . PHP_EOL;
     $mail->setText($entry)->send();
     return $this;
 }
예제 #2
0
파일: Mail.php 프로젝트: popphp/pop-log
 /**
  * Write to a custom log
  *
  * @param  string $content
  * @return Mail
  */
 public function writeCustomLog($content)
 {
     $subject = isset($this->options['subject']) ? $this->options['subject'] : 'Custom Log Entry';
     $mail = new \Pop\Mail\Mail($subject, $this->emails);
     if (isset($this->options['headers'])) {
         $mail->setHeaders($this->options['headers']);
     }
     $mail->setText($content . PHP_EOL)->send();
     return $this;
 }