diff --git a/modules/system/classes/MailManager.php b/modules/system/classes/MailManager.php index b27be05f8..ed707b29b 100644 --- a/modules/system/classes/MailManager.php +++ b/modules/system/classes/MailManager.php @@ -340,6 +340,11 @@ class MailManager $plugins = PluginManager::instance()->getPlugins(); foreach ($plugins as $pluginId => $pluginObj) { + $layouts = $pluginObj->registerMailLayouts(); + if (is_array($layouts)) { + $this->registerMailLayouts($layouts); + } + $templates = $pluginObj->registerMailTemplates(); if (is_array($templates)) { $this->registerMailTemplates($templates); diff --git a/modules/system/classes/PluginBase.php b/modules/system/classes/PluginBase.php index 46e59d098..18df4541f 100644 --- a/modules/system/classes/PluginBase.php +++ b/modules/system/classes/PluginBase.php @@ -202,6 +202,22 @@ class PluginBase extends ServiceProviderBase return []; } + /** + * Registers any mail layouts implemented by this plugin. + * The layouts must be returned in the following format: + * + * return [ + * 'marketing' => 'acme.blog::layouts.marketing', + * 'notification' => 'acme.blog::layouts.notification', + * ]; + * + * @return array + */ + public function registerMailLayouts() + { + return []; + } + /** * Registers any mail templates implemented by this plugin. * The templates must be returned in the following format: