How to Customize Email Notifications in Snipe-IT: A Complete Technical Guide

You can customize Snipe-IT email notifications by modifying the Blade templates in resources/views/vendor/notifications/, extending notification classes in app/Notifications/, or overriding Mailable configurations in app/Mail/ to change subjects, recipients, CC/BCC fields, and overall branding.

Snipe-IT, the open-source IT asset management system by Grokability, leverages Laravel's notification architecture to send checkout alerts, check-in confirmations, and system emails. Learning how to customize email notifications in Snipe-IT requires understanding its modular flow: controllers trigger Notification classes, which invoke Mailable objects, which render Blade templates before delivery via your configured mail driver.

Understanding the Email Notification Architecture

Snipe-IT processes outgoing emails through a five-layer pipeline defined in the source code:

  1. Trigger – Controllers fire events (e.g., asset checkout).
  2. Notification – Classes in app/Notifications/ (like CheckoutAssetNotification.php) define the logic and recipient determination via the toMail() method.
  3. Mailable – The notification instantiates a Mailable (e.g., App\Mail\CheckoutAssetMail) which extends BaseMailable.php.
  4. Blade View – The Mailable renders templates from resources/views/vendor/notifications/email.blade.php (HTML) or email-plain.blade.php (text).
  5. Mail Driver – Laravel's driver (configured in config/mail.php and .env) handles SMTP delivery.

Because every notification passes through BaseMailable and the vendor notification views, you can centrally customize branding, or individually modify specific notification types.

Configure Global Mail Settings

Start by configuring your mail transport and default sender in the environment and configuration files.

Edit your .env file to set SMTP credentials and the default "From" address:

MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_FROM_ADDRESS=noreply@company.com
MAIL_FROM_NAME="IT Asset Management"

These values populate config/mail.php, which sets the global defaults for all Snipe-IT emails. For per-notification sender overrides, modify the constructor in app/Mail/BaseMailable.php to call $this->from('custom@example.com', 'Custom Name') before returning the view.

Customize Notification Content and Recipients

Modify Subject Lines and Language Strings

Email subjects are defined in language files, not hardcoded in classes. To change the wording of checkout notifications, edit resources/lang/en-US/mail.php:

'Asset_Checkout_Notification' => 'Equipment Assigned: :tag',

Create corresponding entries for other locales as needed. The trans() helper in notification classes pulls these strings dynamically.

Override Notification Classes for CC/BCC

To add recipients or custom headers, extend the notification classes in app/Notifications/. For example, to CC an administrator on every asset checkout, edit CheckoutAssetNotification.php:

public function toMail($notifiable)
{
    return (new MailMessage)
        ->subject(trans('mail.Asset_Checkout_Notification', ['tag' => $this->item->asset_tag]))
        ->cc('admin@company.com')               // ← Add CC
        ->bcc('audit@company.com')              // ← Add BCC
        ->markdown('mail.checkout-asset', [
            'item' => $this->item,
        ]);
}

The via($notifiable) method determines the channel (typically ['mail']), while toMail() constructs the MailMessage object that Laravel converts to a Mailable.

Extend Mailable Classes for Custom Data

For deeper customization, modify the specific Mailable (e.g., app/Mail/CheckoutAssetMail.php). The build() method assembles the view and data:

public function build()
{
    return $this->markdown('mail.checkout-asset')
                ->with([
                    'company_policy' => setting('company.policy_text'),
                    'custom_footer' => 'Confidential - Internal Use Only',
                ]);
}

This injects variables into the Blade template that standard notifications do not provide.

Customize Email Templates and Layout

Edit the Master HTML Wrapper

All HTML emails share the layout in resources/views/vendor/notifications/email.blade.php. Customize this to add company logos, custom CSS, or uniform headers:

@component('mail::message')
@if (config('app.logo_url'))
    <img src="{{ config('app.logo_url') }}" alt="Company Logo" style="max-height: 60px; margin-bottom: 20px;">
@endif

{{ $slot }}

@component('mail::footer')
© {{ date('Y') }} {{ config('app.name') }} – All rights reserved.
@endcomponent
@endcomponent

For plain-text emails, edit resources/views/vendor/notifications/email-plain.blade.php.

Customize Markdown Fragments

Individual notification types use specific markdown views (e.g., resources/views/mail/markdown/bulk-asset-checkout-mail.blade.php). These fragments render inside the master template. Edit these to change table layouts, button styles, or specific content blocks for bulk operations without affecting the global wrapper.

Create Custom Notification Types

To add entirely new email types (e.g., "Maintenance Reminder"), create a class in app/Notifications/MaintenanceReminder.php:

<?php
namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;

class MaintenanceReminder extends Notification
{
    use Queueable;

    protected $asset;
    protected $dueDate;

    public function __construct($asset, $dueDate)
    {
        $this->asset = $asset;
        $this->dueDate = $dueDate;
    }

    public function via($notifiable)
    {
        return ['mail'];
    }

    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject('Maintenance Due: ' . $this->asset->asset_tag)
            ->markdown('mail.maintenance-reminder', [
                'asset' => $this->asset,
                'dueDate' => $this->dueDate,
            ]);
    }
}

Create the corresponding view at resources/views/mail/markdown/maintenance-reminder.blade.php, then dispatch with:

$user->notify(new MaintenanceReminder($asset, $nextServiceDate));

Practical Code Examples

Adding BCC to Checkout Notifications

// app/Notifications/CheckoutAssetNotification.php
public function toMail($notifiable)
{
    return (new MailMessage)
        ->subject(trans('mail.Asset_Checkout_Notification', ['tag' => $this->item->asset_tag]))
        ->bcc('compliance@company.com')
        ->markdown('mail.checkout-asset', ['item' => $this->item]);
}
{{-- resources/views/vendor/notifications/email.blade.php --}}
@component('mail::message')
<div style="text-align: center; margin-bottom: 20px;">
    <img src="{{ asset('img/company-logo.png') }}" alt="Logo" style="height: 50px;">
</div>

{{ $slot }}

@component('mail::footer')
This email was sent from Snipe-IT Asset Management System.
@endcomponent
@endcomponent

Injecting Custom Placeholders

Modify app/Mail/CheckoutAssetMail.php to pass additional data:

public function build()
{
    return $this->markdown('mail.checkout-asset')
                ->with(['emergency_contact' => setting('emergency_phone')]);
}

Then use it in resources/views/mail/markdown/checkout-asset.blade.php:

@component('mail::panel')
**Emergency IT Support:** {{ $emergency_contact }}
@endcomponent

Key Source Files Reference

File Purpose
config/mail.php Global mail driver configuration and defaults
app/Notifications/CheckoutAssetNotification.php Checkout event notification logic
app/Mail/BaseMailable.php Base class for all mailables (global styles, from address)
app/Mail/CheckoutAssetMail.php Specific mailable for asset checkouts
resources/views/vendor/notifications/email.blade.php Master HTML email template
resources/views/vendor/notifications/email-plain.blade.php Plain-text fallback template
resources/views/mail/markdown/*.blade.php Individual notification markdown fragments
resources/lang/en-US/mail.php Subject line and body language strings

Summary

  • Configure SMTP in .env and config/mail.php to establish connectivity and default sender addresses.
  • Change subjects by editing translation files in resources/lang/ rather than hardcoding in classes.
  • Add CC/BCC by overriding the toMail() method in notification classes like CheckoutAssetNotification.php.
  • Customize layouts by editing resources/views/vendor/notifications/email.blade.php for global HTML changes, or individual markdown files in resources/views/mail/markdown/ for specific notification types.
  • Create new notifications by extending Illuminate\Notifications\Notification in app/Notifications/ and defining the toMail() method.
  • Clear caches with php artisan optimize:clear after modifying configuration or view files to ensure Laravel picks up changes immediately.

Frequently Asked Questions

How do I change the "From" address on all Snipe-IT emails?

Update the MAIL_FROM_ADDRESS and MAIL_FROM_NAME variables in your .env file. For per-notification overrides, modify the from() call in app/Mail/BaseMailable.php or the specific Mailable class constructor.

Where are email templates stored in Snipe-IT?

HTML email templates are located in resources/views/vendor/notifications/email.blade.php, while plain-text versions use email-plain.blade.php. Individual notification content fragments reside in resources/views/mail/markdown/ (e.g., bulk-asset-checkout-mail.blade.php).

How do I add a CC recipient to checkout notifications?

Extend the toMail() method in app/Notifications/CheckoutAssetNotification.php to include the ->cc('email@example.com') chain method on the MailMessage object before returning it.

What is the difference between Notification classes and Mailable classes in Snipe-IT?

Notification classes (in app/Notifications/) determine when and to whom emails are sent, handling recipient logic and channel selection. Mailable classes (in app/Mail/) define how the email looks, assembling view data and rendering templates. Notifications typically return Mailable instances via the toMail() method.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →