Fix notification channels in ApplicationDeploymentJob and DeploymentSuccess

This commit is contained in:
Andras Bacsai 2024-03-01 19:07:21 +01:00
parent a4d173c733
commit f70a9c6974
2 changed files with 7 additions and 3 deletions

View File

@ -1651,7 +1651,7 @@ private function next(string $status)
if (!$this->only_this_server) {
$this->deploy_to_additional_destinations();
}
// $this->application->environment->project->team?->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview));
$this->application->environment->project->team?->notify(new DeploymentSuccess($this->application, $this->deployment_uuid, $this->preview));
}
}

View File

@ -43,7 +43,11 @@ public function __construct(Application $application, string $deployment_uuid, A
public function via(object $notifiable): array
{
return setNotificationChannels($notifiable, 'deployments');
$channels = setNotificationChannels($notifiable, 'deployments');
$channels = array_filter($channels, function ($channel) {
return $channel !== 'App\Notifications\Channels\EmailChannel';
});
return $channels;
}
public function toMail(): MailMessage
@ -69,7 +73,7 @@ public function toMail(): MailMessage
public function toDiscord(): string
{
if ($this->preview) {
$message = 'Coolify: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '
$message = 'Coolify: New PR' . $this->preview->pull_request_id . ' version successfully deployed of ' . $this->application_name . '
';
if ($this->preview->fqdn) {