lthn.io/app/Core/Events/MailSending.php
Claude 41a90cbff8
feat: lthn.io API serving live chain data
Fixed: basePath self→static binding, namespace detection, event wiring,
SQLite cache, file cache driver. All Mod Boot classes converted to
$listens pattern for lifecycle event discovery.

Working endpoints:
- /v1/explorer/info — live chain height, difficulty, aliases
- /v1/explorer/stats — formatted chain statistics
- /v1/names/directory — alias directory grouped by type
- /v1/names/available/{name} — name availability check
- /v1/names/lookup/{name} — name details

Co-Authored-By: Charon <charon@lethean.io>
2026-04-03 17:17:42 +01:00

66 lines
1.5 KiB
PHP

<?php
/*
* Core PHP Framework
*
* Licensed under the European Union Public Licence (EUPL) v1.2.
* See LICENSE file for details.
*/
declare(strict_types=1);
namespace Core\Events;
/**
* Fired when mail functionality is needed.
*
* Modules listen to this event to register mail templates, custom mailers,
* or mail-related services. This enables lazy loading of mail dependencies
* until email actually needs to be sent.
*
* ## When This Event Fires
*
* Fired when the mail system initializes, typically just before sending
* the first email in a request.
*
* ## Usage Example
*
* ```php
* public static array $listens = [
* MailSending::class => 'onMail',
* ];
*
* public function onMail(MailSending $event): void
* {
* $event->mailable(OrderConfirmationMail::class);
* $event->mailable(WelcomeEmail::class);
* }
* ```
*/
class MailSending extends LifecycleEvent
{
/** @var array<int, string> Collected mailable class names */
protected array $mailableRequests = [];
/**
* Register a mailable class.
*
* @param string $class Fully qualified mailable class name
*/
public function mailable(string $class): void
{
$this->mailableRequests[] = $class;
}
/**
* Get all registered mailable class names.
*
* @return array<int, string>
*
* @internal Used by mail system
*/
public function mailableRequests(): array
{
return $this->mailableRequests;
}
}