A plugin should be able to publish its own mail layouts and partials, like the System\Classes\PluginBase::registerMailTemplates method.
There is no easy way to integrate layouts or partials of a plugin
current
@TimFoerster feel free to submit a PR to introduce that feature :) Will need an accompanying docs entry
I register layouts and partials like this:
use System\Classes\MailManager;
class Plugin extends PluginBase
{
public function register()
{
MailManager::instance()->registerCallback(function ($manager) {
$manager->registerMailLayouts([
'l-welcome' => 'akme.plugin::mail.layout-welcome',
]);
$manager->registerMailPartials([
'p-head' => 'akme.plugin::mail.partial-head',
'p-header' => 'akme.plugin::mail.partial-header',
'p-body' => 'akme.plugin::mail.partial-body',
'p-footer' => 'akme.plugin::mail.partial-footer',
'p-picture' => 'akme.plugin::mail.partial-picture',
]);
});
}
}
Support to register partials has been added in https://github.com/octobercms/october/pull/3847
implemented by #3850
Most helpful comment
I register layouts and partials like this: