Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: New Notification Settings #4525

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
9c5a758
Create 2024_12_05_212355_create_email_notification_settings_table.php
peaklabs-dev Dec 5, 2024
67b9beb
Create 2024_12_05_212416_create_discord_notification_settings_table.php
peaklabs-dev Dec 5, 2024
832239b
Create 2024_12_05_212440_create_telegram_notification_settings_table.php
peaklabs-dev Dec 5, 2024
33b91e0
feat: migrate old email notification settings from the teams table
peaklabs-dev Dec 5, 2024
fd2d947
feat: migrate old discord notification settings from the teams table
peaklabs-dev Dec 5, 2024
fb49c4d
feat: migrate old telegram notification settings from the teams table
peaklabs-dev Dec 5, 2024
251d4cf
chore: remove comments and improve DB column naming
peaklabs-dev Dec 5, 2024
92992a8
fix: DB migration error
peaklabs-dev Dec 5, 2024
fbd8b96
fix: drop all unused smtp columns
peaklabs-dev Dec 5, 2024
38aa46b
Merge pull request #33 from peaklabs-dev/next
peaklabs-dev Dec 6, 2024
4ff3170
fix: backward compatibility
peaklabs-dev Dec 6, 2024
cc894de
feat: add slack notifications to a new table
peaklabs-dev Dec 6, 2024
19064be
chore: remove unused seeder
peaklabs-dev Dec 6, 2024
d924850
chore: remove unused waitlist stuff
peaklabs-dev Dec 9, 2024
27b880e
chore: remove wired.php (not used anymore)
peaklabs-dev Dec 9, 2024
6438c08
chore: remove unused resale license job
peaklabs-dev Dec 9, 2024
9ed2e37
chore: remove commented out internal notification
peaklabs-dev Dec 9, 2024
fd21a4a
chore: remove more waitlist stuff
peaklabs-dev Dec 9, 2024
5515f07
chore: remove commented out notification
peaklabs-dev Dec 9, 2024
2da4e9a
feat: enable success messages again
peaklabs-dev Dec 9, 2024
bd36149
feat: use new notification stuff inside team model
peaklabs-dev Dec 9, 2024
e40f377
chore: remove more waitlist stuff
peaklabs-dev Dec 9, 2024
c995819
chore: remove unused code
peaklabs-dev Dec 9, 2024
4428b95
chore: fix typo
peaklabs-dev Dec 9, 2024
060c826
chore: remove comment out code
peaklabs-dev Dec 9, 2024
0c08e11
feat: some more notification settings and better defaults
peaklabs-dev Dec 9, 2024
586a1a8
chore: some reordering
peaklabs-dev Dec 9, 2024
a6086ee
feat: New email notification settings
peaklabs-dev Dec 9, 2024
e36ccd3
chore: remove resale license reference
peaklabs-dev Dec 9, 2024
2087664
fix: email notification channel enabled function
peaklabs-dev Dec 9, 2024
2aacb1d
fix: Instance email settins
peaklabs-dev Dec 9, 2024
67438e2
fix: make sure resend is false if SMTP is true and vice versa
peaklabs-dev Dec 9, 2024
ee7a901
fix: Email Notification saving
peaklabs-dev Dec 9, 2024
b13d773
feat: new shared function name `is_transactional_emails_enabled()`
peaklabs-dev Dec 9, 2024
df6c5c5
feat: new shared notifications functions
peaklabs-dev Dec 9, 2024
d289f41
chore: remove functions from shared.php
peaklabs-dev Dec 9, 2024
cf21ae1
feat: Email Notification Settings Model
peaklabs-dev Dec 9, 2024
b535144
feat: Telegram notification settings Model
peaklabs-dev Dec 9, 2024
2166899
feat: Discord notification settings Model
peaklabs-dev Dec 9, 2024
868d80b
feat: Slack notification settings Model
peaklabs-dev Dec 9, 2024
119c184
chore: public settings for email notification
peaklabs-dev Dec 9, 2024
c27e2e3
chore: remove waitlist redirect
peaklabs-dev Dec 9, 2024
5210218
feat: New Discord notification UI
peaklabs-dev Dec 9, 2024
b4b4869
feat: New Slack notification UI
peaklabs-dev Dec 9, 2024
bc726dd
feat: new telegram UI
peaklabs-dev Dec 9, 2024
b650014
feat: use new notification event names
peaklabs-dev Dec 9, 2024
a849bfd
feat: always sent notifications
peaklabs-dev Dec 9, 2024
bf58547
feat: scheduled task success notification
peaklabs-dev Dec 9, 2024
ec1c91f
feat: notification trait
peaklabs-dev Dec 9, 2024
6cab8b4
feat: get discord Webhook form new table
peaklabs-dev Dec 9, 2024
dd9d10c
feat: get Slack Webhook form new table
peaklabs-dev Dec 9, 2024
adaef2d
feat: use new table or instance settings for email
peaklabs-dev Dec 9, 2024
4d23835
feat: use new place for settings and topic IDs for telegram
peaklabs-dev Dec 9, 2024
07a0863
chore: remove log
peaklabs-dev Dec 9, 2024
c4a72fb
Merge branch 'main' into separate-success-and-failure-notifications
peaklabs-dev Dec 9, 2024
fdf757c
Merge branch 'next' into separate-success-and-failure-notifications
peaklabs-dev Dec 9, 2024
2639cf7
fix: slack and discord url now uses text filed because encryption mak…
peaklabs-dev Dec 9, 2024
96c970c
chore: use new notification trait
peaklabs-dev Dec 9, 2024
dedfd72
fix: notification trait
peaklabs-dev Dec 9, 2024
014c6dc
chore: remove unused route
peaklabs-dev Dec 9, 2024
bdfd68b
chore: remove unused email component
peaklabs-dev Dec 9, 2024
b17a61a
feat: encrypt instance email settings
peaklabs-dev Dec 10, 2024
d62962a
fix: encryption fixes
peaklabs-dev Dec 10, 2024
d3ce6d8
feat: use encryption in instance settings model
peaklabs-dev Dec 10, 2024
ddfd777
fix: docker cleanup email template
peaklabs-dev Dec 10, 2024
96d4754
Update EmailNotificationSettings.php
peaklabs-dev Dec 10, 2024
99eea78
feat: scheduled task success and failure notifications
peaklabs-dev Dec 10, 2024
ba6d05b
chore: comment status changes as it is disabled for now
peaklabs-dev Dec 10, 2024
b4dd7cd
fix: add missing deployment notifications to telegram
peaklabs-dev Dec 10, 2024
3b5e714
feat: add docker cleanup success and failure notification settings co…
peaklabs-dev Dec 10, 2024
9453981
feat: UI for docker cleanup success and failure notification
peaklabs-dev Dec 10, 2024
78d07f0
feat: docker cleanup email views
peaklabs-dev Dec 10, 2024
0375db0
feat: Docker cleanup success and failure notification files
peaklabs-dev Dec 10, 2024
eaeacb6
feat: scheduled task success email
peaklabs-dev Dec 10, 2024
f360439
feat: send new docker cleanup notifications
peaklabs-dev Dec 10, 2024
3030df9
fix: new docker cleanup settings are now saved to the DB correctly
peaklabs-dev Dec 10, 2024
e24fbdd
Merge branch 'next' into separate-success-and-failure-notifications
peaklabs-dev Dec 10, 2024
e316815
Merge branch 'next' into separate-success-and-failure-notifications
peaklabs-dev Dec 10, 2024
368c888
Merge branch 'next' into separate-success-and-failure-notifications
andrasbacsai Dec 11, 2024
1257ab6
fix: ui + migrations
andrasbacsai Dec 11, 2024
6a7b283
fix: docker cleanup email notifications
andrasbacsai Dec 11, 2024
c915bf9
fix: general notifications does not go through email channel
andrasbacsai Dec 11, 2024
fcc94e6
fixes
andrasbacsai Dec 11, 2024
c084233
fixes
andrasbacsai Dec 11, 2024
b442965
fix: test notifications to only send it to the right channel
andrasbacsai Dec 11, 2024
9ffae89
fix: remove resale_license from db as well
andrasbacsai Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading