feat: implement Hetzner deletion failure notification system with email and messaging support

This commit is contained in:
Andras Bacsai
2025-10-10 09:35:58 +02:00
parent bbaef03602
commit 513f6b54f7
5 changed files with 205 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ namespace App\Actions\Server;
use App\Models\CloudProviderToken;
use App\Models\Server;
use App\Models\Team;
use App\Notifications\Server\HetznerDeletionFailed;
use App\Services\HetznerService;
use Lorisleiva\Actions\Concerns\AsAction;
@@ -92,6 +94,10 @@ class DeleteServer
'hetzner_server_id' => $hetznerServerId,
'team_id' => $teamId,
]);
// Notify the team about the failure
$team = Team::find($teamId);
$team?->notify(new HetznerDeletionFailed($hetznerServerId, $teamId, $e->getMessage()));
}
}
}