Mailer final readonly class
Minn\Mail\Mailer · public/minn/src/Minn/Mail/Mailer.php · 102 lines
Sends a Message through the configured transport. Failures are logged and reported as false; nothing here throws into a request.
Constants and properties
| private | readonly Minn\Mail\MailSettings $settings | Promoted from the constructor. |
| private | readonly string $logFile | Promoted from the constructor. |
Public
| new | __construct(Minn\Mail\MailSettings $settings, string $logFile)# | |
| static | forSite(Minn\Content\Site $site): self# | A mailer using the site's own settings. |
| static | mail(array|string $to, string $subject, string $body): bool# | The one-line send: a recipient, a subject, a body, through the site's transport and sender, with nothing to construct at the call site. |
| static | commentHeaders(string $author, string $email, string $host, string $charset, string $siteName): string# | The headers a comment notice is sent with, as the reference writes them: from the commenter's name (the site's when they gave none) at wordpress@ the site's host (no www.), plain text in the site's charset, replies to the commenter's address when there is one, the bare address for a nameless commenter (probe functions-formatting-doubts). |
| static | noticesFor(Minn\Content\Site $site): Minn\Mail\Notices# | The engine's own notices, worded once, from this site's name and address. |
| method | send(Minn\Mail\Message $message): bool# | Sends one message; false on failure. With WordPress's mail function loaded the message goes through wp_mail(), so its filters and the phpmailer_init hook (an SMTP plugin's way in) apply as they do on the reference; otherwise through the configured transport directly. |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | viaSmtp(string $from, string $fromName, array $to, Minn\Mail\Message $message): bool# |
| |||
| private | viaMail(string $from, string $fromName, array $to, Minn\Mail\Message $message): bool# |
| |||
| private | draft(string $mailer, string $from, string $fromName, array $to, Minn\Mail\Message $message): Minn\Mail\Draft# |
|
Nothing matches.