5c9e13f87b
Signed-off-by: Sebastian <krupinski01@gmail.com>
90 lines
2.2 KiB
PHP
90 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace KTXM\Mail;
|
|
|
|
use KTXF\Event\DeliveryMode;
|
|
use KTXF\Event\EventListenerRegistrarInterface;
|
|
use KTXF\Module\Configuration\BrowserModuleContextInterface;
|
|
use KTXF\Module\Configuration\ModuleContextInterface;
|
|
use KTXF\Module\ModuleInstanceAbstract;
|
|
|
|
/**
|
|
* Mail Module - Email Client
|
|
*/
|
|
class Module extends ModuleInstanceAbstract
|
|
{
|
|
|
|
public function __construct(
|
|
private readonly EventListenerRegistrarInterface $events,
|
|
) {}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->events->listen(
|
|
$this->handle(),
|
|
CompositionSavedEvent::class,
|
|
CompositionSyncListener::class,
|
|
'onCompositionSaved',
|
|
DeliveryMode::Deferred,
|
|
);
|
|
}
|
|
|
|
public function handle(): string
|
|
{
|
|
return 'mail';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'Mail';
|
|
}
|
|
|
|
public function author(): string
|
|
{
|
|
return 'Ktrix';
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'Email client interface - provides a 3-column responsive mail client for reading, composing, and managing email messages';
|
|
}
|
|
|
|
public function version(): string
|
|
{
|
|
return '0.0.1';
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
'mail' => [
|
|
'label' => 'Access Mail',
|
|
'description' => 'View and access the mail client',
|
|
'group' => 'Mail'
|
|
],
|
|
'mail.compose' => [
|
|
'label' => 'Compose Mail',
|
|
'description' => 'Compose and send email messages',
|
|
'group' => 'Mail'
|
|
],
|
|
'mail.delete' => [
|
|
'label' => 'Delete Mail',
|
|
'description' => 'Delete email messages',
|
|
'group' => 'Mail'
|
|
],
|
|
'mail.*' => [
|
|
'label' => 'Full Mail Access',
|
|
'description' => 'All mail operations',
|
|
'group' => 'Mail'
|
|
],
|
|
];
|
|
}
|
|
|
|
public function configure(ModuleContextInterface $context): void
|
|
{
|
|
if ($context instanceof BrowserModuleContextInterface) {
|
|
$context->registerModule($this, 'Mail', 'static/module.mjs');
|
|
}
|
|
}
|
|
}
|