Sending notifications | laravel-backup-server | Spatie

 SPATIE

  Laravel Backup Server
========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-backup-server](https://spatie.be/docs/laravel-backup-server/v1)  Sending-notifications  Sending notifications

 Version   v4   v3   v2   v1

 Other versions for crawler [v4](https://spatie.be/docs/laravel-backup-server/v4) [v3](https://spatie.be/docs/laravel-backup-server/v3) [v2](https://spatie.be/docs/laravel-backup-server/v2) [v1](https://spatie.be/docs/laravel-backup-server/v1)

  Sending notifications
- [ Introduction ](https://spatie.be/docs/laravel-backup-server/v1/introduction)
- [ Getting a license ](https://spatie.be/docs/laravel-backup-server/v1/getting-a-license)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-backup-server/v1/installation-setup)
- [ Requirements ](https://spatie.be/docs/laravel-backup-server/v1/requirements)
- [ Questions and issues ](https://spatie.be/docs/laravel-backup-server/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-backup-server/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-backup-server/v1/about-us)
- [ License ](https://spatie.be/docs/laravel-backup-server/v1/license)

Taking backups
--------------

- [ Creating a destination ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/creating-a-destination)
- [ Creating a source ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/creating-a-source)
- [ Taking backups ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/taking-backups)
- [ The backup process ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/the-backup-process)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/events)
- [ Listing sources and destinations ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/listing-sources-and-destinations)
- [ Working with backups ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/working-with-backups)
- [ Creating database backups ](https://spatie.be/docs/laravel-backup-server/v1/taking-backups/creating-database-backups)

Cleaning up backups
-------------------

- [ The clean up process ](https://spatie.be/docs/laravel-backup-server/v1/cleaning-up-backups/the-cleanup-process)
- [ Determining old backups ](https://spatie.be/docs/laravel-backup-server/v1/cleaning-up-backups/determining-old-backups)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v1/cleaning-up-backups/events)

Monitoring the health of all backups
------------------------------------

- [ The monitoring process ](https://spatie.be/docs/laravel-backup-server/v1/monitoring-the-health-of-all-backups/the-monitoring-process)
- [ Checking health of sources ](https://spatie.be/docs/laravel-backup-server/v1/monitoring-the-health-of-all-backups/checking-health-of-sources)
- [ Checking health of destinations ](https://spatie.be/docs/laravel-backup-server/v1/monitoring-the-health-of-all-backups/checking-health-of-destinations)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v1/monitoring-the-health-of-all-backups/events)

Sending notifications
---------------------

- [ Sending notifications ](https://spatie.be/docs/laravel-backup-server/v1/sending-notifications/sending-notifications)
- [ Adding extra notification channels ](https://spatie.be/docs/laravel-backup-server/v1/sending-notifications/adding-extra-notification-channels)
- [ Customizing the notifiable ](https://spatie.be/docs/laravel-backup-server/v1/sending-notifications/customizing-the-notifiable)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-backup-server                                                                                                                                                                                                                                    `

Sending notifications
=====================

###  On this page

1. [ Configuration ](#content-configuration)

The package leverages Laravel's native notifications to let you know that your backups are ok, or not. Out of the box it can send notifications via mail and Slack.

Configuration
-----------------------------------------------------------------------------------------------

This is the portion of the configuration that will determine when and how notifications will be sent.

```
// config/backup-server.php
'notifications' => [

    /*
     * Backup Server sends out notifications on several events. Out of the box, mails and Slack messages
     * can be sent.
     */
    'notifications' => [
        \Spatie\BackupServer\Notifications\Notifications\BackupCompletedNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\BackupFailedNotification::class => ['mail'],

        \Spatie\BackupServer\Notifications\Notifications\CleanupForSourceCompletedNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\CleanupForSourceFailedNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\CleanupForDestinationCompletedNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\CleanupForDestinationFailedNotification::class => ['mail'],

        \Spatie\BackupServer\Notifications\Notifications\HealthySourceFoundNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\UnhealthySourceFoundNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\HealthyDestinationFoundNotification::class => ['mail'],
        \Spatie\BackupServer\Notifications\Notifications\UnhealthyDestinationFoundNotification::class => ['mail'],
    ],

    /*
     * Here you can specify the notifiable to which the notifications should be sent. The default
     * notifiable will use the variables specified in this config file.
     */
    'notifiable' => \Spatie\BackupServer\Notifications\Notifiable::class,

    'mail' => [
        'to' => 'your@example.com',

        'from' => [
            'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
            'name' => env('MAIL_FROM_NAME', 'Example'),
        ],
    ],

    'slack' => [
        'webhook_url' => '',

        /*
         * If this is set to null the default channel of the web hook will be used.
         */
        'channel' => null,

        'username' => null,

        'icon' => null,

    ],
],
```

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
