Add SnapshotActionMail class and email template for snapshot actions; implement email notifications for create, remove, and revert actions

This commit is contained in:
baodev0
2026-07-17 10:17:52 +07:00
parent abc12b71ef
commit d9da3b5bb3
6 changed files with 353 additions and 21 deletions
@@ -9,7 +9,6 @@ use App\Jobs\VirtualMachine\Snapshot\CreateSnapshot;
use App\Jobs\VirtualMachine\Snapshot\RevertSnapshot;
use App\Jobs\VirtualMachine\Snapshot\RemoveSnapshot;
use App\Models\ModuleSnapshot;
use App\Models\ModuleVmware;
use App\Services\ActivityLogger;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -40,12 +39,12 @@ class SnapshotController extends Controller
$snapshotName = sprintf('%s-%s-%d', $vm->name, $today, $existingCount + 1);
$snapshot = ModuleSnapshot::create([
'name' => $snapshotName,
'description' => $payload['description'] ?? null,
'customer_id' => $customer->id,
'name' => $snapshotName,
'description' => $payload['description'] ?? null,
'customer_id' => $customer->id,
'module_vmware_id' => $vm->id,
'status' => 'pending',
'snapshot_ref' => null,
'status' => 'pending',
'snapshot_ref' => null,
]);
CreateSnapshot::dispatch($snapshot->id);
@@ -62,10 +61,10 @@ class SnapshotController extends Controller
'error' => false,
'message' => 'Đã gửi yêu cầu tạo snapshot vào hàng đợi',
'data' => [
'id' => $snapshot->id,
'name' => $snapshot->name,
'id' => $snapshot->id,
'name' => $snapshot->name,
'description' => $snapshot->description,
'status' => 'pending',
'status' => 'pending',
],
]);
}