Exemple #1
0
 /**
  * Send the message
  *
  * Note: this method exists, and is public so it can be mocked
  * @param Mailgun $mailgun
  * @param array.<string,string> $cfg Config values for Mailgun
  * @return boolean
  * @throws Exception If the email could not be sent
  */
 public function sendMessage(Mailgun $mailgun, $from, $to, $subject, $text)
 {
     $domain = Config::getRequired("sndsgd.log.writer.mailgun.domain");
     return $mailgun->sendMessage($domain, ["from" => $from, "to" => $to, "subject" => $subject, "text" => $text]);
 }
Exemple #2
0
 /**
  * Get an absolute file path for a named log
  *
  * @param string $name The name of the log
  * @return string The absolute file path
  * @throws Exception If the config value is not set
  */
 public static function getPathFromName($name = 'error')
 {
     $dir = Config::get('sndsgd.log.file.dir', self::DEFAULT_DIR);
     return "{$dir}/{$name}.log";
 }