Skip to content

Commit

Permalink
Merge pull request #4525 from peaklabs-dev/separate-success-and-failu…
Browse files Browse the repository at this point in the history
…re-notifications

Feat: New Notification Settings
  • Loading branch information
andrasbacsai authored Dec 11, 2024
2 parents 2083009 + 9ffae89 commit 53dfe80
Show file tree
Hide file tree
Showing 92 changed files with 2,572 additions and 1,413 deletions.
1 change: 0 additions & 1 deletion app/Console/Commands/CleanupUnreachableServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function handle()
if ($servers->count() > 0) {
foreach ($servers as $server) {
echo "Cleanup unreachable server ($server->id) with name $server->name";
// send_internal_notification("Server $server->name is unreachable for 7 days. Cleaning up...");
$server->update([
'ip' => '1.2.3.4',
]);
Expand Down
23 changes: 1 addition & 22 deletions app/Console/Commands/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace App\Console\Commands;

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\Waitlist;
use App\Notifications\Application\DeploymentFailed;
use App\Notifications\Application\DeploymentSuccess;
use App\Notifications\Application\StatusChanged;
Expand Down Expand Up @@ -64,8 +62,6 @@ public function handle()
'backup-success' => 'Database - Backup Success',
'backup-failed' => 'Database - Backup Failed',
// 'invitation-link' => 'Invitation Link',
'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',
],
Expand Down Expand Up @@ -187,7 +183,7 @@ public function handle()
'team_id' => 0,
]);
}
// $this->mail = (new BackupSuccess($backup->frequency, $db->name))->toMail();
//$this->mail = (new BackupSuccess($backup->frequency, $db->name))->toMail();
$this->sendEmail();
break;
// case 'invitation-link':
Expand All @@ -204,23 +200,6 @@ public function handle()
// $this->mail = (new InvitationLink($user))->toMail();
// $this->sendEmail();
// break;
case 'waitlist-invitation-link':
$this->mail = new MailMessage;
$this->mail->view('emails.waitlist-invitation', [
'loginLink' => 'https://coolify.io',
]);
$this->mail->subject('Congratulations! You are invited to join Coolify Cloud.');
$this->sendEmail();
break;
case 'waitlist-confirmation':
$found = Waitlist::where('email', $this->email)->first();
if ($found) {
SendConfirmationForWaitlistJob::dispatch($this->email, $found->uuid);
} else {
throw new Exception('Waitlist not found');
}

break;
case 'realusers-before-trial':
$this->mail = new MailMessage;
$this->mail->view('emails.before-trial-conversion');
Expand Down
114 changes: 0 additions & 114 deletions app/Console/Commands/WaitlistInvite.php

This file was deleted.

58 changes: 0 additions & 58 deletions app/Console/Commands/Weird.php

This file was deleted.

4 changes: 1 addition & 3 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ public function verify()
public function email_verify(EmailVerificationRequest $request)
{
$request->fulfill();
$name = request()->user()?->name;

// send_internal_notification("User {$name} verified their email address.");
return redirect(RouteServiceProvider::HOME);
}

public function forgot_password(Request $request)
{
if (is_transactional_emails_active()) {
if (is_transactional_emails_enabled()) {
$arrayOfRequest = $request->only(Fortify::email());
$request->merge([
'email' => Str::lower($arrayOfRequest['email']),
Expand Down
63 changes: 0 additions & 63 deletions app/Http/Controllers/Webhook/Waitlist.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Jobs/ApplicationDeploymentJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,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));
}
}

Expand Down
28 changes: 0 additions & 28 deletions app/Jobs/CheckResaleLicenseJob.php

This file was deleted.

4 changes: 3 additions & 1 deletion app/Jobs/DatabaseBackupJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ public function handle(): void
if ($this->backup->save_s3) {
$this->upload_to_s3();
}
//$this->team?->notify(new BackupSuccess($this->backup, $this->database, $database));

$this->team->notify(new BackupSuccess($this->backup, $this->database, $database));

$this->backup_log->update([
'status' => 'success',
'message' => $this->backup_output,
Expand Down
Loading

0 comments on commit 53dfe80

Please sign in to comment.