Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

email: server lost connection

Andras Bacsai898563fe7cf0
diff --git a/app/Console/Commands/Emails.php b/app/Console/Commands/Emails.php
index d6a8827408..67c50675f6 100644
--- a/app/Console/Commands/Emails.php
+++ b/app/Console/Commands/Emails.php
@@ -6,6 +6,7 @@ use App\Jobs\SendConfirmationForWaitlistJob;
use App\Models\Application;
use App\Models\ApplicationPreview;
use App\Models\ScheduledDatabaseBackup;
+use App\Models\Server;
use App\Models\StandalonePostgresql;
use App\Models\Team;
use App\Models\TeamInvitation;
@@ -65,9 +66,10 @@ class Emails extends Command
'waitlist-invitation-link' => 'Waitlist Invitation Link',
'waitlist-confirmation' => 'Waitlist Confirmation',
'realusers-before-trial' => 'REAL - Registered Users Before Trial without Subscription',
+ 'realusers-server-lost-connection' => 'REAL - Server Lost Connection',
],
);
- $emailsGathered = ['realusers-before-trial'];
+ $emailsGathered = ['realusers-before-trial','realusers-server-lost-connection'];
if (!in_array($type, $emailsGathered)) {
$this->email = text('Email Address to send to');
}
@@ -199,6 +201,32 @@ class Emails extends Command
}
}
break;
+ case 'realusers-server-lost-connection':
+ $serverId = text('Server Id');
+ $server = Server::find($serverId);
+ if (!$server) {
+ throw new Exception('Server not found');
+ }
+ $admins = [];
+ $members = $server->team->members;
+ foreach ($members as $member) {
+ if ($member->isAdmin()) {
+ $admins[] = $member->email;
+ }
+ }
+ $this->info('Sending to ' . count($admins) . ' admins.');
+ foreach ($admins as $admin) {
+ $this->info($admin);
+ }
+ $this->mail = new MailMessage();
+ $this->mail->view('emails.server-lost-connection', [
+ 'name' => $server->name,
+ ]);
+ $this->mail->subject('Action required: Server ' . $server->name . ' lost connection.');
+ foreach ($admins as $email) {
+ $this->sendEmail($email);
+ }
+ break;
}
}
private function sendEmail(string $email = null)
diff --git a/resources/views/emails/server-lost-connection.blade.php b/resources/views/emails/server-lost-connection.blade.php
new file mode 100644
index 0000000000..67aa0816a6
--- /dev/null
+++ b/resources/views/emails/server-lost-connection.blade.php
@@ -0,0 +1,7 @@
+<x-emails.layout>
+Coolify Cloud cannot connect to your server ({{$name}}). Please check your server and make sure it is running.
+
+If you have any questions, please contact us.
+
+</x-emails.layout>
+