EmailChannel
in package
implements
NotificationChannelInterface
FinalYes
Sends notifications via email.
The default mailer uses PHP's built-in mail() function for zero dependencies; inject a callable mailer to use Symfony Mailer, PHPMailer, SwiftMailer, etc.
Table of Contents
Interfaces
- NotificationChannelInterface
- A delivery mechanism for notifications. Implementations should swallow transient delivery errors rather than propagating them; the pipeline must not crash because Slack is down.
Methods
- __construct() : mixed
- name() : string
- Stable identifier for routing or filtering (e.g., "slack", "email", "log").
- send() : void
Methods
__construct()
public
__construct(string $to, string $from[, string $name = 'email' ][, string $subjectPrefix = '' ][, callable(string, string, string, array<int, string>): void|null $mailer = null ]) : mixed
Parameters
- $to : string
-
Recipient address.
- $from : string
-
Sender address.
- $name : string = 'email'
-
Channel identifier.
- $subjectPrefix : string = ''
-
Prepended to every subject line, e.g. "[xrechnung-kit] ".
- $mailer : callable(string, string, string, array<int, string>): void|null = null
name()
Stable identifier for routing or filtering (e.g., "slack", "email", "log").
public
name() : string
Attributes
- #[Override]
Return values
stringsend()
public
send(Notification $notification) : void
Parameters
- $notification : Notification
Attributes
- #[Override]