mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-29 02:30:05 +02:00
Add support to use Cc and Bcc in the notification system
This commit is contained in:
parent
ef8a591c8c
commit
20aa01174c
|
@ -225,11 +225,11 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
||||||
if (self::$failedTasks === 0) {
|
if (self::$failedTasks === 0) {
|
||||||
$exitCode = 0;
|
$exitCode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self::$deployStatus === self::FAILED) {
|
if (self::$deployStatus === self::FAILED) {
|
||||||
$exitCode = 1;
|
$exitCode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $exitCode;
|
return $exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,6 +590,8 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
||||||
$projectName = $this->getConfig()->general('name', false);
|
$projectName = $this->getConfig()->general('name', false);
|
||||||
$projectEmail = $this->getConfig()->general('email', false);
|
$projectEmail = $this->getConfig()->general('email', false);
|
||||||
$notificationsEnabled = $this->getConfig()->general('notifications', false);
|
$notificationsEnabled = $this->getConfig()->general('notifications', false);
|
||||||
|
$ccEmail = $this->getConfig()->general('email_options.cc', null);
|
||||||
|
$bccEmail = $this->getConfig()->general('email_options.bcc', null);
|
||||||
|
|
||||||
// We need notifications enabled, and a project name and email to send the notification
|
// We need notifications enabled, and a project name and email to send the notification
|
||||||
if (!$projectName || !$projectEmail || !$notificationsEnabled) {
|
if (!$projectName || !$projectEmail || !$notificationsEnabled) {
|
||||||
|
@ -600,8 +602,17 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
||||||
$mailer->setAddress($projectEmail)
|
$mailer->setAddress($projectEmail)
|
||||||
->setProject($projectName)
|
->setProject($projectName)
|
||||||
->setLogFile(Console::getLogFile())
|
->setLogFile(Console::getLogFile())
|
||||||
->setEnvironment($this->getConfig()->getEnvironment())
|
->setEnvironment($this->getConfig()->getEnvironment());
|
||||||
->send($result);
|
|
||||||
|
if ($ccEmail) {
|
||||||
|
$mailer->setCc($ccEmail);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($bccEmail) {
|
||||||
|
$mailer->setBcc($bccEmail);
|
||||||
|
}
|
||||||
|
|
||||||
|
$mailer->send($result);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue