fix: docker cleanup email notifications

This commit is contained in:
Andras Bacsai
2024-12-11 10:50:10 +01:00
parent 1257ab6ff4
commit 6a7b283844
5 changed files with 16 additions and 18 deletions

View File

@@ -25,8 +25,8 @@ class DockerCleanupFailed extends CustomEmailNotification
$mail = new MailMessage;
$mail->subject("Coolify: [ACTION REQUIRED] Docker cleanup job failed on {$this->server->name}");
$mail->view('emails.docker-cleanup-failed', [
'serverName' => $this->server->name,
'message' => $this->message,
'name' => $this->server->name,
'text' => $this->message,
]);
return $mail;

View File

@@ -25,14 +25,13 @@ class DockerCleanupSuccess extends CustomEmailNotification
$mail = new MailMessage;
$mail->subject("Coolify: Docker cleanup job succeeded on {$this->server->name}");
$mail->view('emails.docker-cleanup-success', [
'serverName' => $this->server->name,
'message' => $this->message,
'name' => $this->server->name,
'text' => $this->message,
]);
return $mail;
}
public function toDiscord(): DiscordMessage
{
return new DiscordMessage(

View File

@@ -1,8 +1,8 @@
<x-emails.layout>
Docker Cleanup on {{ $serverName }} FAILED with the following error:
Docker Cleanup on {{ $name }} FAILED with the following error:
<pre>
{{ $message }}
{{ $text }}
</pre>
</x-emails.layout>

View File

@@ -1,8 +1,9 @@
<x-emails.layout>
Docker Cleanup on "{{ $serverName }}" succeeded with the following message:
Docker Cleanup on {{ $name }} succeeded with the following message:
<pre>
"{{ $message }}"
{{ $text }}
</pre>
</x-emails.layout>
</x-emails.layout>

View File

@@ -142,14 +142,12 @@
<div class="border dark:border-coolgray-300 p-4 rounded-lg">
<h3 class="font-medium mb-3">Server</h3>
<div class="flex flex-col gap-1.5 pl-1">
<x-forms.checkbox instantSave="saveModel"
helper="Send an email when Docker Cleanup is run on a server."
id="dockerCleanupSuccessEmailNotifications" label="Docker Cleanup Success" />
<x-forms.checkbox instantSave="saveModel"
helper="Send an email when Docker Cleanup fails on a server."
id="dockerCleanupFailureEmailNotifications" label="Docker Cleanup Failure" />
<x-forms.checkbox instantSave="saveModel" helper="Send an email when server disk usage is high."
id="serverDiskUsageEmailNotifications" label="Server Disk Usage" />
<x-forms.checkbox instantSave="saveModel" id="dockerCleanupSuccessEmailNotifications"
label="Docker Cleanup Success" />
<x-forms.checkbox instantSave="saveModel" id="dockerCleanupFailureEmailNotifications"
label="Docker Cleanup Failure" />
<x-forms.checkbox instantSave="saveModel" id="serverDiskUsageEmailNotifications"
label="Server Disk Usage" />
<x-forms.checkbox instantSave="saveModel" id="serverReachableEmailNotifications"
label="Server Reachable" />
<x-forms.checkbox instantSave="saveModel" id="serverUnreachableEmailNotifications"