diff --git a/modules/system/classes/MailManager.php b/modules/system/classes/MailManager.php index 62b6bf2c0..ff21d5231 100644 --- a/modules/system/classes/MailManager.php +++ b/modules/system/classes/MailManager.php @@ -151,7 +151,7 @@ class MailManager $html = $this->renderTwig($template->layout->content_html, [ 'content' => $html, 'css' => $template->layout->content_css, - 'brandCss' => MailBrandSetting::compileCss() + 'brandCss' => MailBrandSetting::renderCss() ] + (array) $data); } diff --git a/modules/system/controllers/MailBrandSettings.php b/modules/system/controllers/MailBrandSettings.php index 608c191c6..c210b2ed1 100644 --- a/modules/system/controllers/MailBrandSettings.php +++ b/modules/system/controllers/MailBrandSettings.php @@ -1,9 +1,11 @@ exists) { - return $this->update($setting->id); - } - else { - return $this->create(); - } + $setting->resetCache(); + + return $this->create(); + } + + public function index_onSave() + { + $setting = MailBrandSetting::instance(); + + return $this->create_onSave(); + } + + public function index_onResetDefault() + { + $setting = MailBrandSetting::instance(); + + $setting->resetDefault(); + + Flash::success(Lang::get('backend::lang.form.reset_success')); + + return Redirect::refresh(); } public function onUpdateSampleMessage() diff --git a/modules/system/controllers/MailTemplates.php b/modules/system/controllers/MailTemplates.php index 787ce1acf..5e0f95ad9 100644 --- a/modules/system/controllers/MailTemplates.php +++ b/modules/system/controllers/MailTemplates.php @@ -45,11 +45,13 @@ class MailTemplates extends Controller SettingsManager::setContext('October.System', 'mail_templates'); } - public function index() + public function index($tab = null) { MailTemplate::syncAll(); $this->asExtension('ListController')->index(); $this->bodyClass = 'compact-container'; + + $this->vars['activeTab'] = $tab ?: 'templates'; } public function formBeforeSave($model) diff --git a/modules/system/controllers/mailbrandsettings/index.htm b/modules/system/controllers/mailbrandsettings/index.htm index 99e4331c3..2e9dbfb60 100644 --- a/modules/system/controllers/mailbrandsettings/index.htm +++ b/modules/system/controllers/mailbrandsettings/index.htm @@ -25,24 +25,16 @@ class="btn btn-primary"> = e(trans('backend::lang.form.save')) ?> - = e(trans('backend::lang.form.or')) ?> = e(trans('backend::lang.form.cancel')) ?> diff --git a/modules/system/controllers/maillayouts/config_form.yaml b/modules/system/controllers/maillayouts/config_form.yaml index 644f0bd89..a2f90b6f8 100644 --- a/modules/system/controllers/maillayouts/config_form.yaml +++ b/modules/system/controllers/maillayouts/config_form.yaml @@ -5,12 +5,12 @@ name: system::lang.mail_templates.layout form: ~/modules/system/models/maillayout/fields.yaml modelClass: System\Models\MailLayout -defaultRedirect: system/mailtemplates +defaultRedirect: system/mailtemplates/index/layouts create: redirect: system/maillayouts/update/:id - redirectClose: system/mailtemplates + redirectClose: system/mailtemplates/index/layouts update: redirect: system/mailtemplates - redirectClose: system/mailtemplates + redirectClose: system/mailtemplates/index/layouts diff --git a/modules/system/controllers/maillayouts/create.htm b/modules/system/controllers/maillayouts/create.htm index 7eba080d2..3f997937b 100644 --- a/modules/system/controllers/maillayouts/create.htm +++ b/modules/system/controllers/maillayouts/create.htm @@ -1,6 +1,6 @@
= e(trans('system::lang.mail_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/maillayouts/update.htm b/modules/system/controllers/maillayouts/update.htm index 092b6a729..62bab8bed 100644 --- a/modules/system/controllers/maillayouts/update.htm +++ b/modules/system/controllers/maillayouts/update.htm @@ -1,6 +1,6 @@= e(trans('system::lang.mail_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailpartials/config_form.yaml b/modules/system/controllers/mailpartials/config_form.yaml index ddff13239..92b624b2b 100644 --- a/modules/system/controllers/mailpartials/config_form.yaml +++ b/modules/system/controllers/mailpartials/config_form.yaml @@ -5,12 +5,12 @@ name: system::lang.mail_templates.partial form: ~/modules/system/models/mailpartial/fields.yaml modelClass: System\Models\MailPartial -defaultRedirect: system/mailtemplates +defaultRedirect: system/mailtemplates/index/partials create: redirect: system/mailpartials/update/:id - redirectClose: system/mailtemplates + redirectClose: system/mailtemplates/index/partials update: - redirect: system/mailtemplates - redirectClose: system/mailtemplates + redirect: system/mailtemplates/index/partials + redirectClose: system/mailtemplates/index/partials diff --git a/modules/system/controllers/mailpartials/create.htm b/modules/system/controllers/mailpartials/create.htm index ddceee22e..dc1e3b39a 100644 --- a/modules/system/controllers/mailpartials/create.htm +++ b/modules/system/controllers/mailpartials/create.htm @@ -1,6 +1,6 @@= e(trans('system::lang.mail_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailpartials/update.htm b/modules/system/controllers/mailpartials/update.htm index ef93ad422..b5e5ea706 100644 --- a/modules/system/controllers/mailpartials/update.htm +++ b/modules/system/controllers/mailpartials/update.htm @@ -1,6 +1,6 @@= e(trans('system::lang.mail_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailtemplates/index.htm b/modules/system/controllers/mailtemplates/index.htm index 683d31f51..8d4b4ee21 100644 --- a/modules/system/controllers/mailtemplates/index.htm +++ b/modules/system/controllers/mailtemplates/index.htm @@ -1,17 +1,29 @@| - {{ body }} + + {{ body }} + |