diff --git a/.env.example b/.env.example index 6623f480..ef743489 100644 --- a/.env.example +++ b/.env.example @@ -99,7 +99,7 @@ BACKUP_ENABLED=true BACKUP_APP_NAME="${APP_NAME}-backup" BACKUP_DISK=local BACKUP_ARCHIVE_PASSWORD=null -BACKUP_NOTIFICATION_EMAIL=your@example.com +BACKUP_NOTIFICATION_EMAIL= # Storage & Cloud Backup(works with cloudflare r2 or s3) AWS_ACCESS_KEY_ID= diff --git a/config/backup.php b/config/backup.php index c78616f9..99635378 100644 --- a/config/backup.php +++ b/config/backup.php @@ -198,12 +198,12 @@ */ 'notifications' => [ 'notifications' => [ - \Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => env('BACKUP_NOTIFICATION_EMAIL') ? ['mail'] : [], + \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => env('BACKUP_NOTIFICATION_EMAIL') ? ['mail'] : [], + \Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => env('BACKUP_NOTIFICATION_EMAIL') ? ['mail'] : [], + \Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => env("BACKUP_NOTIFICATION_EMAIL") ? ['mail'] : [], + \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => env("BACKUP_NOTIFICATION_EMAIL") ? ['mail'] : [], + \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => env("BACKUP_NOTIFICATION_EMAIL") ? ['mail'] : [], ], /*