Mail Templates
The Mail Templates module stores reusable mail-template definitions.
For now, a mail template only links to a content template. Mail rendering and delivery behavior can be layered on later.
Install
composer require qore-next/mail-templates
The package auto-discovers MailTemplatesServiceProvider.
Publish migrations:
php artisan vendor:publish --tag=qore-next.mail-templates.db
php artisan vendor:publish --tag=qore-next.templates.db
php artisan migrate
The module also has publishable config:
php artisan vendor:publish --tag=qore-next.mail-templates.config
Data Model
MailTemplate stores:
name;- editable unique
code_name, generated fromnamein the resource form; - required
template_idrelation to aTemplate.
Resource
Enable the module in Qore's modules UI. On enable it creates CRUDA permissions for mail_templates; on disable it deletes the mail_templates permission category.
The resource includes a form/detail-only node field that links to the selected template detail page.
When enabled, the module registers:
MailTemplatePolicy;MailTemplateResource;- translations, config and migrations.
Register the frontend module in resources/js/app.tsx so the mail-template icon is loaded:
import mailTemplatesModule from '../../vendor/qore-next/mail-templates/resources/js'
<QoreAppProvider
app={{
// ...
modules: [mailTemplatesModule]
}}
/>