Merge pull request #2318 from CachetHQ/silent-component-changes
Component notifications can be silenced
This commit is contained in:
@@ -50,7 +50,7 @@ class UpdateComponentCommandHandler
|
||||
$component = $command->component;
|
||||
$originalStatus = $component->status;
|
||||
|
||||
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status));
|
||||
event(new ComponentStatusWasUpdatedEvent($this->auth->user(), $component, $originalStatus, $command->status, $command->silent));
|
||||
|
||||
$component->update($this->filter($command));
|
||||
|
||||
|
||||
@@ -111,7 +111,8 @@ class ReportIncidentCommandHandler
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
null,
|
||||
false
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
{
|
||||
$component = $event->component;
|
||||
|
||||
// If we're silent, then don't send this.
|
||||
if ($event->silent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't email anything if the status hasn't changed.
|
||||
if ($event->original_status === $event->new_status) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user