2024-12-09 14:47:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class EmailNotificationSettings extends Model
|
|
|
|
|
{
|
|
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'team_id',
|
|
|
|
|
|
|
|
|
|
'smtp_enabled',
|
|
|
|
|
'smtp_from_address',
|
|
|
|
|
'smtp_from_name',
|
|
|
|
|
'smtp_recipients',
|
|
|
|
|
'smtp_host',
|
|
|
|
|
'smtp_port',
|
|
|
|
|
'smtp_encryption',
|
|
|
|
|
'smtp_username',
|
|
|
|
|
'smtp_password',
|
|
|
|
|
'smtp_timeout',
|
|
|
|
|
|
|
|
|
|
'resend_enabled',
|
|
|
|
|
'resend_api_key',
|
|
|
|
|
|
|
|
|
|
'use_instance_email_settings',
|
|
|
|
|
|
|
|
|
|
'deployment_success_email_notifications',
|
|
|
|
|
'deployment_failure_email_notifications',
|
|
|
|
|
'status_change_email_notifications',
|
|
|
|
|
'backup_success_email_notifications',
|
|
|
|
|
'backup_failure_email_notifications',
|
|
|
|
|
'scheduled_task_success_email_notifications',
|
|
|
|
|
'scheduled_task_failure_email_notifications',
|
|
|
|
|
'server_disk_usage_email_notifications',
|
feat(server): implement server patch check notifications
- Added a new job, ServerPatchCheckJob, to handle server patch checks and notifications.
- Introduced a new notification class, ServerPatchCheck, for sending updates via email, Discord, Slack, Pushover, and Telegram.
- Updated notification settings models to include server patch notification options for email, Discord, Slack, Pushover, and Telegram.
- Created a migration to add server patch notification fields to the respective settings tables.
- Enhanced the UI to allow users to enable/disable server patch notifications across different channels.
2025-05-26 12:03:59 +00:00
|
|
|
'server_patch_email_notifications',
|
2025-11-13 12:38:57 +00:00
|
|
|
'traefik_outdated_email_notifications',
|
2024-12-09 14:47:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'smtp_enabled' => 'boolean',
|
|
|
|
|
'smtp_from_address' => 'encrypted',
|
2024-12-10 13:17:23 +00:00
|
|
|
'smtp_from_name' => 'encrypted',
|
2024-12-09 14:47:05 +00:00
|
|
|
'smtp_recipients' => 'encrypted',
|
|
|
|
|
'smtp_host' => 'encrypted',
|
|
|
|
|
'smtp_port' => 'integer',
|
|
|
|
|
'smtp_username' => 'encrypted',
|
|
|
|
|
'smtp_password' => 'encrypted',
|
|
|
|
|
'smtp_timeout' => 'integer',
|
|
|
|
|
|
|
|
|
|
'resend_enabled' => 'boolean',
|
|
|
|
|
'resend_api_key' => 'encrypted',
|
|
|
|
|
|
|
|
|
|
'use_instance_email_settings' => 'boolean',
|
|
|
|
|
|
|
|
|
|
'deployment_success_email_notifications' => 'boolean',
|
|
|
|
|
'deployment_failure_email_notifications' => 'boolean',
|
|
|
|
|
'status_change_email_notifications' => 'boolean',
|
|
|
|
|
'backup_success_email_notifications' => 'boolean',
|
|
|
|
|
'backup_failure_email_notifications' => 'boolean',
|
|
|
|
|
'scheduled_task_success_email_notifications' => 'boolean',
|
|
|
|
|
'scheduled_task_failure_email_notifications' => 'boolean',
|
|
|
|
|
'server_disk_usage_email_notifications' => 'boolean',
|
feat(server): implement server patch check notifications
- Added a new job, ServerPatchCheckJob, to handle server patch checks and notifications.
- Introduced a new notification class, ServerPatchCheck, for sending updates via email, Discord, Slack, Pushover, and Telegram.
- Updated notification settings models to include server patch notification options for email, Discord, Slack, Pushover, and Telegram.
- Created a migration to add server patch notification fields to the respective settings tables.
- Enhanced the UI to allow users to enable/disable server patch notifications across different channels.
2025-05-26 12:03:59 +00:00
|
|
|
'server_patch_email_notifications' => 'boolean',
|
2025-11-13 12:38:57 +00:00
|
|
|
'traefik_outdated_email_notifications' => 'boolean',
|
2024-12-09 14:47:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function team()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Team::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isEnabled()
|
|
|
|
|
{
|
|
|
|
|
return $this->smtp_enabled || $this->resend_enabled || $this->use_instance_email_settings;
|
|
|
|
|
}
|
|
|
|
|
}
|