> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unleash-commerce.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Notifications

> Replace and customize notifications in Unleash Commerce Core

## Overview

Core notifications are exposed via contracts, so you can swap implementations without changing core code. Each notification has a contract in `Esign\UnleashCommerce\Core\Contracts\Notifications` and a default implementation in `Esign\UnleashCommerce\Core\Notifications`.

## Replace a core notification

Create a custom notification that implements the same contract. You can extend the core notification and override the parts you need:

```php theme={null}
namespace App\Notifications;

use Esign\UnleashCommerce\Core\Contracts\Notifications\OrderConfirmationNotification as OrderConfirmationNotificationContract;
use Esign\UnleashCommerce\Core\Notifications\OrderConfirmationNotification as BaseOrderConfirmationNotification;
use Illuminate\Notifications\Messages\MailMessage;

class OrderConfirmationNotification extends BaseOrderConfirmationNotification implements OrderConfirmationNotificationContract
{
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject('Your order is confirmed')
            ->line('Thanks for your purchase.')
            ->action('View your order', route('orders.index'));
    }
}
```

## Bind the notification contract

Bind the contract to your custom class in a service provider:

```php theme={null}
<?php

namespace App\Providers;

use App\Notifications\OrderConfirmationNotification;
use Esign\UnleashCommerce\Core\Contracts\Notifications\OrderConfirmationNotification as OrderConfirmationNotificationContract;
use Illuminate\Support\ServiceProvider;

class UnleashCommerceServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->registerNotifications();
    }

    protected function registerNotifications(): void
    {
        $this->app->bind(
            OrderConfirmationNotificationContract::class,
            OrderConfirmationNotification::class
        );
    }
}
```

## Available notification contracts

See the full list in the [Notifications Reference](../reference/notifications).
