Skip to content

Commit

Permalink
Improve settings allowing multiple watch configuraiton
Browse files Browse the repository at this point in the history
  • Loading branch information
Slivo-fr committed Mar 27, 2019
1 parent 108cf18 commit ba1920e
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 147 deletions.
23 changes: 19 additions & 4 deletions AlertHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
class AlertHandler
{

public static function sendAlertMail(Exception $e) {
/**
* @param Exception $e
* @throws \Twig_Error_Loader
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
public static function sendAlertMail(Exception $e)
{

$transport = (new Swift_SmtpTransport(Settings::$SMTP_SERVER, Settings::$SMTP_PORT, Settings::$SECURITY))
->setUsername(Settings::$SMTP_USER)
Expand All @@ -22,8 +29,8 @@ public static function sendAlertMail(Exception $e) {
array(
'ssl' => array(
'allow_self_signed' => true,
'verify_peer' => false
)
'verify_peer' => false,
),
)
);
}
Expand All @@ -39,9 +46,17 @@ public static function sendAlertMail(Exception $e) {
if ($mailer->send($message)) {
echo 'Alert mail sent' . PHP_EOL;
} else {
echo 'Failed to send alert mail' . PHP_EOL;
echo 'Failed to send alert mail' . PHP_EOL;
}
}

/**
* @param Exception $e
* @return string
* @throws \Twig_Error_Loader
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
protected static function generateBody(Exception $e)
{
$loader = new \Twig_Loader_Filesystem('.');
Expand Down
Loading

0 comments on commit ba1920e

Please sign in to comment.