alfasix / alfakit-mail-templates
Editable email templates for AlfaKit panels: admins edit the subject and body of AlfaKit's, its plugins' and your mails per locale with merge tags, preview them with sample data, send a test to themselves, reset to the default and browse the history.
Package info
github.com/alfasixbh/alfakit-mail-templates
pkg:composer/alfasix/alfakit-mail-templates
Requires
- php: ^8.4
- alfasix/alfakit: ^0.2|@dev
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
by Alfa Six
This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.
Editable email templates for AlfaKit panels. Admins edit the subject and body of AlfaKit's, its plugins' and your own emails per language in the rich editor with merge tags, preview them with sample data in light and dark, send a test to themselves, reset to the default and restore earlier versions. It renders in React, Vue and Svelte with AlfaKit's built-in components.
Installation
composer require alfasix/alfakit-mail-templates
php artisan vendor:publish --tag=alfakit-mail-templates-migrations
php artisan vendor:publish --tag=alfakit-record-versions-migrations # once, for the history
php artisan migrate
Register
use AlfaSix\AlfakitMailTemplates\MailTemplatesPlugin; $panel->plugin( MailTemplatesPlugin::make() ->authorize(fn (User $user): bool => $user->is_admin) ->locales(['en', 'ar']), );
Without authorize(), only users the manageAlfakitMailTemplates gate allows can open it.
Your own emails
Use the UsesEditableTemplate trait and register the email with MailDefinition::make('orders.shipped')->editable([...]). See the emails guide and the plugin docs.
License
MIT. See LICENSE.md.