mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Added registerMailLayouts method to PluginBase (#3850)
Fixes #3820. Credit to @tobias-kuendig
This commit is contained in:
parent
0415e4133d
commit
7b4e293074
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user