Use Notifier::memory() for local development or tests.
<?php
declare(strict_types=1);
use CommonPHP\Notifications\Notification;
use CommonPHP\Notifications\Notifier;
$notifier = Notifier::memory('email');
$result = $notifier->send(
new Notification(
subject: 'Welcome',
body: 'Thanks for creating an account.',
recipients: ['ada@example.com'],
tags: ['welcome'],
),
'email',
);
echo $result->status()->value;For real delivery, register a provider driver:
$notifier->useChannel('email', $smtpDriver, default: true);