diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index 86402a0ab..10ebed318 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -7,7 +7,7 @@ use BackendMenu; use BackendAuth; use Backend\Classes\WidgetManager; use October\Rain\Support\ModuleServiceProvider; -use System\Models\EmailTemplate; +use System\Models\MailTemplate; use System\Classes\SettingsManager; class ServiceProvider extends ModuleServiceProvider @@ -117,12 +117,12 @@ class ServiceProvider extends ModuleServiceProvider }); /* - * Register email templates + * Register mail templates */ - EmailTemplate::registerCallback(function($template){ - $template->registerEmailTemplates([ - 'backend::emails.invite' => 'Invitation for newly created administrators.', - 'backend::emails.restore' => 'Password reset instructions for backend-end administrators.', + MailTemplate::registerCallback(function($template){ + $template->registerMailTemplates([ + 'backend::mail.invite' => 'Invitation for newly created administrators.', + 'backend::mail.restore' => 'Password reset instructions for backend-end administrators.', ]); }); } diff --git a/modules/backend/controllers/Auth.php b/modules/backend/controllers/Auth.php index 3e47628a8..4254da550 100644 --- a/modules/backend/controllers/Auth.php +++ b/modules/backend/controllers/Auth.php @@ -130,7 +130,7 @@ class Auth extends Controller 'link' => $link, ]; - Mail::send('backend::emails.restore', $data, function($message) use ($user) + Mail::send('backend::mail.restore', $data, function($message) use ($user) { $message->to($user->email, $user->full_name)->subject(trans('backend::lang.account.password_reset')); }); diff --git a/modules/backend/controllers/editorpreferences/config_form.yaml b/modules/backend/controllers/editorpreferences/config_form.yaml index 954284a78..e0aa539ca 100644 --- a/modules/backend/controllers/editorpreferences/config_form.yaml +++ b/modules/backend/controllers/editorpreferences/config_form.yaml @@ -4,4 +4,4 @@ form: @/modules/backend/models/editorpreferences/fields.yaml modelClass: Backend\Models\EditorPreferences -defaultRedirect: system/emailtemplates +defaultRedirect: system/mailtemplates diff --git a/modules/backend/models/User.php b/modules/backend/models/User.php index 4b94a7991..c4d72918d 100644 --- a/modules/backend/models/User.php +++ b/modules/backend/models/User.php @@ -97,7 +97,7 @@ class User extends UserBase 'link' => Backend::url('backend'), ]; - Mail::send('backend::emails.invite', $data, function($message) + Mail::send('backend::mail.invite', $data, function($message) { $message->to($this->email, $this->full_name); }); diff --git a/modules/backend/views/emails/invite.htm b/modules/backend/views/mail/invite.htm similarity index 100% rename from modules/backend/views/emails/invite.htm rename to modules/backend/views/mail/invite.htm diff --git a/modules/backend/views/emails/restore.htm b/modules/backend/views/mail/restore.htm similarity index 100% rename from modules/backend/views/emails/restore.htm rename to modules/backend/views/mail/restore.htm diff --git a/modules/system/ServiceProvider.php b/modules/system/ServiceProvider.php index 779f6e8fc..9f4662441 100644 --- a/modules/system/ServiceProvider.php +++ b/modules/system/ServiceProvider.php @@ -15,8 +15,8 @@ use System\Classes\SettingsManager; use System\Twig\Engine as TwigEngine; use System\Twig\Loader as TwigLoader; use System\Twig\Extension as TwigExtension; -use System\Models\EmailSettings; -use System\Models\EmailTemplate; +use System\Models\MailSettings; +use System\Models\MailTemplate; use Backend\Classes\WidgetManager; use October\Rain\Support\ModuleServiceProvider; @@ -101,8 +101,8 @@ class ServiceProvider extends ModuleServiceProvider * Override system email with email settings */ Event::listen('mailer.beforeRegister', function() { - if (EmailSettings::isConfigured()) - EmailSettings::applyConfigValues(); + if (MailSettings::isConfigured()) + MailSettings::applyConfigValues(); }); /* @@ -110,7 +110,7 @@ class ServiceProvider extends ModuleServiceProvider */ Event::listen('mailer.register', function($provider, $mailer) { $mailer->bindEvent('beforeAddContent', function($message, $view, $plain, $data){ - if (EmailTemplate::addContentToMailer($message, $view, $data)) + if (MailTemplate::addContentToMailer($message, $view, $data)) return false; }); }); @@ -177,7 +177,7 @@ class ServiceProvider extends ModuleServiceProvider $manager->registerPermissions('October.System', [ 'system.manage_settings' => ['label' => 'Manage system settings', 'tab' => 'System'], 'system.manage_updates' => ['label' => 'Manage software updates', 'tab' => 'System'], - 'system.manage_email_templates' => ['label' => 'Manage email templates', 'tab' => 'System'], + 'system.manage_mail_templates' => ['label' => 'Manage mail templates', 'tab' => 'System'], ]); }); @@ -187,19 +187,19 @@ class ServiceProvider extends ModuleServiceProvider SettingsManager::instance()->registerCallback(function($manager){ $manager->registerSettingItems('October.System', [ 'email_settings' => [ - 'label' => 'system::lang.email.menu_label', - 'description' => 'system::lang.email.menu_description', + 'label' => 'system::lang.mail.menu_label', + 'description' => 'system::lang.mail.menu_description', 'category' => 'System', 'icon' => 'icon-envelope', - 'class' => 'System\Models\EmailSettings', + 'class' => 'System\Models\MailSettings', 'sort' => 100 ], - 'email_templates' => [ - 'label' => 'system::lang.email_templates.menu_label', - 'description' => 'system::lang.email_templates.menu_description', + 'mail_templates' => [ + 'label' => 'system::lang.mail_templates.menu_label', + 'description' => 'system::lang.mail_templates.menu_description', 'category' => 'System', 'icon' => 'icon-envelope-square', - 'url' => Backend::url('system/emailtemplates'), + 'url' => Backend::url('system/mailtemplates'), 'sort' => 100 ], ]); diff --git a/modules/system/classes/PluginBase.php b/modules/system/classes/PluginBase.php index 61959bd6b..355ec9c44 100644 --- a/modules/system/classes/PluginBase.php +++ b/modules/system/classes/PluginBase.php @@ -106,12 +106,12 @@ abstract class PluginBase extends ServiceProviderBase } /** - * Registers any email templates implemented by this plugin. + * Registers any mail templates implemented by this plugin. * The templates must be returned in the following format: - * ['acme.blog::emails.welcome' => 'This is a description of the welcome template'], - * ['acme.blog::emails.forgot_password' => 'This is a description of the forgot password template'], + * ['acme.blog::mail.welcome' => 'This is a description of the welcome template'], + * ['acme.blog::mail.forgot_password' => 'This is a description of the forgot password template'], */ - public function registerEmailTemplates() + public function registerMailTemplates() { return []; } diff --git a/modules/system/controllers/EmailLayouts.php b/modules/system/controllers/MailLayouts.php similarity index 80% rename from modules/system/controllers/EmailLayouts.php rename to modules/system/controllers/MailLayouts.php index 97563c380..482e5bd66 100644 --- a/modules/system/controllers/EmailLayouts.php +++ b/modules/system/controllers/MailLayouts.php @@ -12,20 +12,20 @@ use System\Classes\ApplicationException; use Exception; /** - * Email layouts controller + * Mail layouts controller * * @package october\system * @author Alexey Bobkov, Samuel Georges * */ -class EmailLayouts extends Controller +class MailLayouts extends Controller { public $implement = [ 'Backend.Behaviors.FormController', ]; - public $requiredPermissions = ['system.manage_email_templates']; + public $requiredPermissions = ['system.manage_mail_templates']; public $formConfig = 'config_form.yaml'; diff --git a/modules/system/controllers/EmailTemplates.php b/modules/system/controllers/MailTemplates.php similarity index 82% rename from modules/system/controllers/EmailTemplates.php rename to modules/system/controllers/MailTemplates.php index 96b6a077a..88d61d2f4 100644 --- a/modules/system/controllers/EmailTemplates.php +++ b/modules/system/controllers/MailTemplates.php @@ -10,18 +10,18 @@ use Redirect; use BackendMenu; use BackendAuth; use Backend\Classes\Controller; -use System\Models\EmailTemplate; +use System\Models\MailTemplate; use System\Classes\ApplicationException; use Exception; /** - * Email templates controller + * Mail templates controller * * @package october\system * @author Alexey Bobkov, Samuel Georges * */ -class EmailTemplates extends Controller +class MailTemplates extends Controller { public $implement = [ @@ -29,7 +29,7 @@ class EmailTemplates extends Controller 'Backend.Behaviors.ListController' ]; - public $requiredPermissions = ['system.manage_email_templates']; + public $requiredPermissions = ['system.manage_mail_templates']; public $listConfig = ['templates' => 'config_templates_list.yaml', 'layouts' => 'config_layouts_list.yaml']; public $formConfig = 'config_form.yaml'; @@ -43,9 +43,9 @@ class EmailTemplates extends Controller public function index() { - /* @todo Remove line if year >= 2015 */ if (!\System\Models\EmailLayout::whereCode('default')->count()) { \Eloquent::unguard(); with(new \System\Database\Seeds\SeedSetupEmailLayouts)->run(); } + /* @todo Remove line if year >= 2015 */ if (!\System\Models\MailLayout::whereCode('default')->count()) { \Eloquent::unguard(); with(new \System\Database\Seeds\SeedSetupMailLayouts)->run(); } - EmailTemplate::syncAll(); + MailTemplate::syncAll(); $this->getClassExtension('Backend.Behaviors.ListController')->index(); } diff --git a/modules/system/controllers/emaillayouts/config_form.yaml b/modules/system/controllers/emaillayouts/config_form.yaml deleted file mode 100644 index 2db90d754..000000000 --- a/modules/system/controllers/emaillayouts/config_form.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# =================================== -# Form Behavior Config -# =================================== - -name: system::lang.email_templates.layout -form: @/modules/system/models/emaillayout/fields.yaml -modelClass: System\Models\EmailLayout -defaultRedirect: system/emailtemplates - -create: - redirect: system/emailtemplates/update/:id - redirectClose: system/emailtemplates - -update: - redirect: system/emailtemplates - redirectClose: system/emailtemplates \ No newline at end of file diff --git a/modules/system/controllers/emailtemplates/_list_layouts_toolbar.htm b/modules/system/controllers/emailtemplates/_list_layouts_toolbar.htm deleted file mode 100644 index 131b0d20e..000000000 --- a/modules/system/controllers/emailtemplates/_list_layouts_toolbar.htm +++ /dev/null @@ -1,7 +0,0 @@ -
\ No newline at end of file diff --git a/modules/system/controllers/emailtemplates/_list_templates_toolbar.htm b/modules/system/controllers/emailtemplates/_list_templates_toolbar.htm deleted file mode 100644 index bf6067d5b..000000000 --- a/modules/system/controllers/emailtemplates/_list_templates_toolbar.htm +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/modules/system/controllers/emailtemplates/config_form.yaml b/modules/system/controllers/emailtemplates/config_form.yaml deleted file mode 100644 index b75a2a253..000000000 --- a/modules/system/controllers/emailtemplates/config_form.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# =================================== -# Form Behavior Config -# =================================== - -name: system::lang.email_templates.template -form: @/modules/system/models/emailtemplate/fields.yaml -modelClass: System\Models\EmailTemplate -defaultRedirect: system/emailtemplates - -create: - redirect: system/emailtemplates/update/:id - redirectClose: system/emailtemplates - -update: - redirect: system/emailtemplates - redirectClose: system/emailtemplates diff --git a/modules/system/controllers/emailtemplates/config_layouts_list.yaml b/modules/system/controllers/emailtemplates/config_layouts_list.yaml deleted file mode 100644 index 53148604e..000000000 --- a/modules/system/controllers/emailtemplates/config_layouts_list.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# =================================== -# List Behavior Config -# =================================== - -title: system::lang.email_templates.menu_label -list: @/modules/system/models/emaillayout/columns.yaml -modelClass: System\Models\EmailLayout -recordUrl: system/emaillayouts/update/:id -noRecordsMessage: backend::lang.list.no_records -showSetup: false - -toolbar: - buttons: list_layouts_toolbar - search: - prompt: backend::lang.list.search_prompt \ No newline at end of file diff --git a/modules/system/controllers/maillayouts/config_form.yaml b/modules/system/controllers/maillayouts/config_form.yaml new file mode 100644 index 000000000..28fcc9273 --- /dev/null +++ b/modules/system/controllers/maillayouts/config_form.yaml @@ -0,0 +1,16 @@ +# =================================== +# Form Behavior Config +# =================================== + +name: system::lang.mail_templates.layout +form: @/modules/system/models/maillayout/fields.yaml +modelClass: System\Models\MailLayout +defaultRedirect: system/mailtemplates + +create: + redirect: system/mailtemplates/update/:id + redirectClose: system/mailtemplates + +update: + redirect: system/mailtemplates + redirectClose: system/mailtemplates \ No newline at end of file diff --git a/modules/system/controllers/emaillayouts/create.htm b/modules/system/controllers/maillayouts/create.htm similarity index 80% rename from modules/system/controllers/emaillayouts/create.htm rename to modules/system/controllers/maillayouts/create.htm index 0de62e35f..12bc73f4a 100644 --- a/modules/system/controllers/emaillayouts/create.htm +++ b/modules/system/controllers/maillayouts/create.htm @@ -1,7 +1,7 @@= e(trans('system::lang.email_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/emaillayouts/update.htm b/modules/system/controllers/maillayouts/update.htm similarity index 83% rename from modules/system/controllers/emaillayouts/update.htm rename to modules/system/controllers/maillayouts/update.htm index d5fa3604a..7bf7baac6 100644 --- a/modules/system/controllers/emaillayouts/update.htm +++ b/modules/system/controllers/maillayouts/update.htm @@ -1,7 +1,7 @@= $formModel->code ?>
= e(trans('system::lang.email_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailtemplates/_list_layouts_toolbar.htm b/modules/system/controllers/mailtemplates/_list_layouts_toolbar.htm new file mode 100644 index 000000000..3a8244642 --- /dev/null +++ b/modules/system/controllers/mailtemplates/_list_layouts_toolbar.htm @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/modules/system/controllers/mailtemplates/_list_templates_toolbar.htm b/modules/system/controllers/mailtemplates/_list_templates_toolbar.htm new file mode 100644 index 000000000..988e79279 --- /dev/null +++ b/modules/system/controllers/mailtemplates/_list_templates_toolbar.htm @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/modules/system/controllers/mailtemplates/config_form.yaml b/modules/system/controllers/mailtemplates/config_form.yaml new file mode 100644 index 000000000..c131d8955 --- /dev/null +++ b/modules/system/controllers/mailtemplates/config_form.yaml @@ -0,0 +1,16 @@ +# =================================== +# Form Behavior Config +# =================================== + +name: system::lang.mail_templates.template +form: @/modules/system/models/mailtemplate/fields.yaml +modelClass: System\Models\MailTemplate +defaultRedirect: system/mailtemplates + +create: + redirect: system/mailtemplates/update/:id + redirectClose: system/mailtemplates + +update: + redirect: system/mailtemplates + redirectClose: system/mailtemplates diff --git a/modules/system/controllers/mailtemplates/config_layouts_list.yaml b/modules/system/controllers/mailtemplates/config_layouts_list.yaml new file mode 100644 index 000000000..d257d8be4 --- /dev/null +++ b/modules/system/controllers/mailtemplates/config_layouts_list.yaml @@ -0,0 +1,15 @@ +# =================================== +# List Behavior Config +# =================================== + +title: system::lang.mail_templates.menu_label +list: @/modules/system/models/maillayout/columns.yaml +modelClass: System\Models\MailLayout +recordUrl: system/maillayouts/update/:id +noRecordsMessage: backend::lang.list.no_records +showSetup: false + +toolbar: + buttons: list_layouts_toolbar + search: + prompt: backend::lang.list.search_prompt \ No newline at end of file diff --git a/modules/system/controllers/emailtemplates/config_templates_list.yaml b/modules/system/controllers/mailtemplates/config_templates_list.yaml similarity index 50% rename from modules/system/controllers/emailtemplates/config_templates_list.yaml rename to modules/system/controllers/mailtemplates/config_templates_list.yaml index 2539c63be..da8dff348 100644 --- a/modules/system/controllers/emailtemplates/config_templates_list.yaml +++ b/modules/system/controllers/mailtemplates/config_templates_list.yaml @@ -2,10 +2,10 @@ # List Behavior Config # =================================== -title: system::lang.email_templates.menu_label -list: @/modules/system/models/emailtemplate/columns.yaml -modelClass: System\Models\EmailTemplate -recordUrl: system/emailtemplates/update/:id +title: system::lang.mail_templates.menu_label +list: @/modules/system/models/mailtemplate/columns.yaml +modelClass: System\Models\MailTemplate +recordUrl: system/mailtemplates/update/:id noRecordsMessage: backend::lang.list.no_records recordsPerPage: 20 showSetup: false diff --git a/modules/system/controllers/emailtemplates/create.htm b/modules/system/controllers/mailtemplates/create.htm similarity index 80% rename from modules/system/controllers/emailtemplates/create.htm rename to modules/system/controllers/mailtemplates/create.htm index 30578600c..6ad31d3cd 100644 --- a/modules/system/controllers/emailtemplates/create.htm +++ b/modules/system/controllers/mailtemplates/create.htm @@ -1,7 +1,7 @@= e(trans('system::lang.email_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/emailtemplates/index.htm b/modules/system/controllers/mailtemplates/index.htm similarity index 81% rename from modules/system/controllers/emailtemplates/index.htm rename to modules/system/controllers/mailtemplates/index.htm index 7849b258f..d485cda8b 100644 --- a/modules/system/controllers/emailtemplates/index.htm +++ b/modules/system/controllers/mailtemplates/index.htm @@ -7,8 +7,8 @@= $formModel->code ?>
= e(trans('system::lang.email_templates.return')) ?>
+= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/database/migrations/2013_10_01_000008_Db_System_Email_Templates.php b/modules/system/database/migrations/2013_10_01_000008_Db_System_Mail_Templates.php similarity index 79% rename from modules/system/database/migrations/2013_10_01_000008_Db_System_Email_Templates.php rename to modules/system/database/migrations/2013_10_01_000008_Db_System_Mail_Templates.php index 0ed55766d..53fdc6d29 100644 --- a/modules/system/database/migrations/2013_10_01_000008_Db_System_Email_Templates.php +++ b/modules/system/database/migrations/2013_10_01_000008_Db_System_Mail_Templates.php @@ -3,12 +3,12 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class DbSystemEmailTemplates extends Migration +class DbSystemMailTemplates extends Migration { public function up() { - Schema::create('system_email_templates', function(Blueprint $table) + Schema::create('system_mail_templates', function(Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); @@ -25,7 +25,7 @@ class DbSystemEmailTemplates extends Migration public function down() { - Schema::dropIfExists('system_email_templates'); + Schema::dropIfExists('system_mail_templates'); } } diff --git a/modules/system/database/migrations/2013_10_01_000009_Db_System_Email_Layouts.php b/modules/system/database/migrations/2013_10_01_000009_Db_System_Mail_Layouts.php similarity index 78% rename from modules/system/database/migrations/2013_10_01_000009_Db_System_Email_Layouts.php rename to modules/system/database/migrations/2013_10_01_000009_Db_System_Mail_Layouts.php index ed6fbc047..d8259a029 100644 --- a/modules/system/database/migrations/2013_10_01_000009_Db_System_Email_Layouts.php +++ b/modules/system/database/migrations/2013_10_01_000009_Db_System_Mail_Layouts.php @@ -3,12 +3,12 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class DbSystemEmailLayouts extends Migration +class DbSystemMailLayouts extends Migration { public function up() { - Schema::create('system_email_layouts', function(Blueprint $table) + Schema::create('system_mail_layouts', function(Blueprint $table) { $table->engine = 'InnoDB'; $table->increments('id'); @@ -24,7 +24,7 @@ class DbSystemEmailLayouts extends Migration public function down() { - Schema::dropIfExists('system_email_layouts'); + Schema::dropIfExists('system_mail_layouts'); } } diff --git a/modules/system/database/seeds/DatabaseSeeder.php b/modules/system/database/seeds/DatabaseSeeder.php index 8afe4d8d2..56fdd7588 100644 --- a/modules/system/database/seeds/DatabaseSeeder.php +++ b/modules/system/database/seeds/DatabaseSeeder.php @@ -15,7 +15,7 @@ class DatabaseSeeder extends Seeder { Eloquent::unguard(); - $this->call('System\Database\Seeds\SeedSetupEmailLayouts'); + $this->call('System\Database\Seeds\SeedSetupMailLayouts'); } } \ No newline at end of file diff --git a/modules/system/database/seeds/SeedSetupEmailLayouts.php b/modules/system/database/seeds/SeedSetupMailLayouts.php similarity index 90% rename from modules/system/database/seeds/SeedSetupEmailLayouts.php rename to modules/system/database/seeds/SeedSetupMailLayouts.php index 4c0d146c2..126e6ce2a 100644 --- a/modules/system/database/seeds/SeedSetupEmailLayouts.php +++ b/modules/system/database/seeds/SeedSetupMailLayouts.php @@ -1,9 +1,9 @@ $text = '{{ message|raw }}'; - EmailLayout::create([ + MailLayout::create([ 'is_locked' => true, 'name' => 'Default', 'code' => 'default', @@ -66,7 +66,7 @@ $text = '{{ message|raw }} This is an automatic message. Please do not reply to it. '; - EmailLayout::create([ + MailLayout::create([ 'is_locked' => true, 'name' => 'System', 'code' => 'system', diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 82965752a..f5f39e9c4 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -66,11 +66,11 @@ return [ 'update_success' => 'Settings for :name have been updated successfully.', 'return' => 'Return to system settings', ], - 'email' => [ - 'menu_label' => 'Email Configuration', + 'mail' => [ + 'menu_label' => 'Mail Configuration', 'menu_description' => 'Manage email configuration.', 'general' => 'General', - 'method' => 'Email Method', + 'method' => 'Mail Method', 'sender_name' => 'Sender Name', 'sender_email' => 'Sender Email', 'smtp' => 'SMTP', @@ -85,14 +85,14 @@ return [ 'sendmail_path' => 'Sendmail Path', 'sendmail_path_comment' => 'Please specify the path of the sendmail program.', ], - 'email_templates' => [ - 'menu_label' => 'Email Templates', - 'menu_description' => 'Modify the email templates that are sent to users and administrators.', + 'mail_templates' => [ + 'menu_label' => 'Mail Templates', + 'menu_description' => 'Modify the mail templates that are sent to users and administrators.', 'new_template' => 'New Template', 'new_layout' => 'New Layout', 'template' => 'Template', 'templates' => 'Templates', - 'menu_layouts_label' => 'Email Layouts', + 'menu_layouts_label' => 'Mail Layouts', 'layout' => 'Layout', 'layouts' => 'Layouts', 'name' => 'Name', diff --git a/modules/system/lang/pt-br/lang.php b/modules/system/lang/pt-br/lang.php index f4da8b5da..39f48112a 100644 --- a/modules/system/lang/pt-br/lang.php +++ b/modules/system/lang/pt-br/lang.php @@ -75,7 +75,7 @@ return [ 'sendmail_path' => 'Caminho do Sendmail', 'sendmail_path_comment' => 'Por favor, especifique o caminho do programa sendmail.', ], - 'email_templates' => [ + 'mail_templates' => [ 'menu_label' => 'Modelos de E-mail', 'menu_description' => 'Modificar os modelos de e-mail que são enviados para usuários e administradores.', 'new_template' => 'Novo modelo', diff --git a/modules/system/lang/ru/lang.php b/modules/system/lang/ru/lang.php index 7bc423302..83a33ce07 100644 --- a/modules/system/lang/ru/lang.php +++ b/modules/system/lang/ru/lang.php @@ -75,7 +75,7 @@ return [ 'sendmail_path' => 'Sendmail Путь', 'sendmail_path_comment' => 'Пожалуйста, укажите путь к sendmail.', ], - 'email_templates' => [ + 'mail_templates' => [ 'menu_label' => 'Шаблоны почты', 'menu_description' => 'Изменение шаблонов писем, отправляемых пользователям и администраторам.', 'new_template' => 'Новый шаблон', diff --git a/modules/system/models/EmailLayout.php b/modules/system/models/MailLayout.php similarity index 74% rename from modules/system/models/EmailLayout.php rename to modules/system/models/MailLayout.php index 9e61c4ee1..e671fde5f 100644 --- a/modules/system/models/EmailLayout.php +++ b/modules/system/models/MailLayout.php @@ -3,15 +3,15 @@ use Model; use System\Classes\ApplicationException; -class EmailLayout extends Model +class MailLayout extends Model { /** * @var string The database table used by the model. */ - protected $table = 'system_email_layouts'; + protected $table = 'system_mail_layouts'; public $rules = [ - 'code' => 'required|unique:system_email_layouts', + 'code' => 'required|unique:system_mail_layouts', 'name' => 'required', 'content_html' => 'required', ]; diff --git a/modules/system/models/EmailSettings.php b/modules/system/models/MailSettings.php similarity index 96% rename from modules/system/models/EmailSettings.php rename to modules/system/models/MailSettings.php index bca503123..ece803ec7 100644 --- a/modules/system/models/EmailSettings.php +++ b/modules/system/models/MailSettings.php @@ -3,11 +3,11 @@ use App; use Model; -class EmailSettings extends Model +class MailSettings extends Model { public $implement = ['System.Behaviors.SettingsModel']; - public $settingsCode = 'system_email_settings'; + public $settingsCode = 'system_mail_settings'; public $settingsFields = 'fields.yaml'; const MODE_MAIL = 'mail'; diff --git a/modules/system/models/EmailTemplate.php b/modules/system/models/MailTemplate.php similarity index 84% rename from modules/system/models/EmailTemplate.php rename to modules/system/models/MailTemplate.php index 16eb2d036..72f15a70e 100644 --- a/modules/system/models/EmailTemplate.php +++ b/modules/system/models/MailTemplate.php @@ -7,26 +7,26 @@ use Model; use October\Rain\Mail\MailParser; use System\Classes\PluginManager; -class EmailTemplate extends Model +class MailTemplate extends Model { /** * @var string The database table used by the model. */ - protected $table = 'system_email_templates'; + protected $table = 'system_mail_templates'; public $rules = [ - 'code' => 'required|unique:system_email_templates', + 'code' => 'required|unique:system_mail_templates', 'subject' => 'required', 'description' => 'required', 'content_html' => 'required', ]; public $belongsTo = [ - 'layout' => ['System\Models\EmailLayout'] + 'layout' => ['System\Models\MailLayout'] ]; /** - * @var array A cache of customised email templates. + * @var array A cache of customised mail templates. */ protected static $cache = []; @@ -58,7 +58,7 @@ class EmailTemplate extends Model * Create new templates */ if (count($newTemplates)) - $categories = EmailLayout::lists('id', 'code'); + $categories = MailLayout::lists('id', 'code'); foreach ($newTemplates as $code => $description) { $sections = self::getTemplateSections($code); @@ -138,7 +138,7 @@ class EmailTemplate extends Model // /** - * Loads registered email templates from modules and plugins + * Loads registered mail templates from modules and plugins * @return void */ public function loadRegisteredTemplates() @@ -149,11 +149,11 @@ class EmailTemplate extends Model $plugins = PluginManager::instance()->getPlugins(); foreach ($plugins as $pluginId => $pluginObj) { - $templates = $pluginObj->registerEmailTemplates(); + $templates = $pluginObj->registerMailTemplates(); if (!is_array($templates)) continue; - $this->registerEmailTemplates($templates); + $this->registerMailTemplates($templates); } } @@ -170,13 +170,13 @@ class EmailTemplate extends Model } /** - * Registers a callback function that defines email templates. + * Registers a callback function that defines mail templates. * The callback function should register templates by calling the manager's - * registerEmailTemplates() function. Thi instance is passed to the + * registerMailTemplates() function. Thi instance is passed to the * callback function as an argument. Usage: *
- * EmailTemplate::registerCallback(function($template){
- * $template->registerEmailTemplates([...]);
+ * MailTemplate::registerCallback(function($template){
+ * $template->registerMailTemplates([...]);
* });
*
* @param callable $callback A callable function.
@@ -187,9 +187,9 @@ class EmailTemplate extends Model
}
/**
- * Registers email views and manageable templates.
+ * Registers mail views and manageable templates.
*/
- public function registerEmailTemplates(array $definitions)
+ public function registerMailTemplates(array $definitions)
{
if (!static::$registeredTemplates)
static::$registeredTemplates = [];
diff --git a/modules/system/models/emailsettings/fields.yaml b/modules/system/models/emailsettings/fields.yaml
deleted file mode 100644
index 447bdf74a..000000000
--- a/modules/system/models/emailsettings/fields.yaml
+++ /dev/null
@@ -1,55 +0,0 @@
-# ===================================
-# Field Definitions
-# ===================================
-
-tabs:
- fields:
-
- send_mode:
- label: system::lang.email.method
- type: dropdown
- tab: system::lang.email.general
-
- sender_name:
- label: system::lang.email.sender_name
- span: auto
- tab: system::lang.email.general
-
- sender_email:
- label: system::lang.email.sender_email
- span: auto
- tab: system::lang.email.general
-
- smtp_address:
- label: system::lang.email.smtp_address
- tab: system::lang.email.smtp
-
- smtp_authorization:
- type: checkbox
- label: system::lang.email.smtp_authorization
- tab: system::lang.email.smtp
- comment: system::lang.email.smtp_authorization_comment
-
- smtp_user:
- label: system::lang.email.smtp_username
- tab: system::lang.email.smtp
- span: left
-
- smtp_password:
- label: system::lang.email.smtp_password
- tab: system::lang.email.smtp
- span: right
-
- smtp_port:
- label: system::lang.email.smtp_port
- tab: system::lang.email.smtp
-
- smtp_ssl:
- type: checkbox
- label: system::lang.email.smtp_ssl
- tab: system::lang.email.smtp
-
- sendmail_path:
- label: system::lang.email.sendmail_path
- commentAbove: system::lang.email.sendmail_path_comment
- tab: system::lang.email.sendmail
\ No newline at end of file
diff --git a/modules/system/models/emaillayout/columns.yaml b/modules/system/models/maillayout/columns.yaml
similarity index 100%
rename from modules/system/models/emaillayout/columns.yaml
rename to modules/system/models/maillayout/columns.yaml
diff --git a/modules/system/models/emaillayout/fields.yaml b/modules/system/models/maillayout/fields.yaml
similarity index 57%
rename from modules/system/models/emaillayout/fields.yaml
rename to modules/system/models/maillayout/fields.yaml
index 1531fe855..68437f39b 100644
--- a/modules/system/models/emaillayout/fields.yaml
+++ b/modules/system/models/maillayout/fields.yaml
@@ -5,17 +5,17 @@
fields:
code:
- label: system::lang.email_templates.code
- comment: system::lang.email_templates.code_comment
+ label: system::lang.mail_templates.code
+ comment: system::lang.mail_templates.code_comment
span: left
context: create
name@create:
- label: system::lang.email_templates.name
+ label: system::lang.mail_templates.name
span: right
name@update:
- label: system::lang.email_templates.name
+ label: system::lang.mail_templates.name
secondaryTabs:
fields:
@@ -23,16 +23,16 @@ secondaryTabs:
content_html:
type: codeeditor
size: giant
- tab: system::lang.email_templates.content_html
+ tab: system::lang.mail_templates.content_html
language: html
content_css:
type: codeeditor
size: giant
- tab: system::lang.email_templates.content_css
+ tab: system::lang.mail_templates.content_css
language: css
content_text:
type: textarea
size: giant
- tab: system::lang.email_templates.content_text
+ tab: system::lang.mail_templates.content_text
diff --git a/modules/system/models/mailsettings/fields.yaml b/modules/system/models/mailsettings/fields.yaml
new file mode 100644
index 000000000..de3ece272
--- /dev/null
+++ b/modules/system/models/mailsettings/fields.yaml
@@ -0,0 +1,55 @@
+# ===================================
+# Field Definitions
+# ===================================
+
+tabs:
+ fields:
+
+ send_mode:
+ label: system::lang.mail.method
+ type: dropdown
+ tab: system::lang.mail.general
+
+ sender_name:
+ label: system::lang.mail.sender_name
+ span: auto
+ tab: system::lang.mail.general
+
+ sender_email:
+ label: system::lang.mail.sender_email
+ span: auto
+ tab: system::lang.mail.general
+
+ smtp_address:
+ label: system::lang.mail.smtp_address
+ tab: system::lang.mail.smtp
+
+ smtp_authorization:
+ type: checkbox
+ label: system::lang.mail.smtp_authorization
+ tab: system::lang.mail.smtp
+ comment: system::lang.mail.smtp_authorization_comment
+
+ smtp_user:
+ label: system::lang.mail.smtp_username
+ tab: system::lang.mail.smtp
+ span: left
+
+ smtp_password:
+ label: system::lang.mail.smtp_password
+ tab: system::lang.mail.smtp
+ span: right
+
+ smtp_port:
+ label: system::lang.mail.smtp_port
+ tab: system::lang.mail.smtp
+
+ smtp_ssl:
+ type: checkbox
+ label: system::lang.mail.smtp_ssl
+ tab: system::lang.mail.smtp
+
+ sendmail_path:
+ label: system::lang.mail.sendmail_path
+ commentAbove: system::lang.mail.sendmail_path_comment
+ tab: system::lang.mail.sendmail
\ No newline at end of file
diff --git a/modules/system/models/emailtemplate/columns.yaml b/modules/system/models/mailtemplate/columns.yaml
similarity index 100%
rename from modules/system/models/emailtemplate/columns.yaml
rename to modules/system/models/mailtemplate/columns.yaml
diff --git a/modules/system/models/emailtemplate/fields.yaml b/modules/system/models/mailtemplate/fields.yaml
similarity index 52%
rename from modules/system/models/emailtemplate/fields.yaml
rename to modules/system/models/mailtemplate/fields.yaml
index 9a3850192..7a2ee8873 100644
--- a/modules/system/models/emailtemplate/fields.yaml
+++ b/modules/system/models/mailtemplate/fields.yaml
@@ -5,27 +5,27 @@
fields:
layout:
- label: system::lang.email_templates.layout
+ label: system::lang.mail_templates.layout
type: relation
options:
emptyOption: -- No layout --
code:
- label: system::lang.email_templates.code
- comment: system::lang.email_templates.code_comment
+ label: system::lang.mail_templates.code
+ comment: system::lang.mail_templates.code_comment
span: left
context: create
subject@create:
- label: system::lang.email_templates.subject
- comment: system::lang.email_templates.subject_comment
+ label: system::lang.mail_templates.subject
+ comment: system::lang.mail_templates.subject_comment
span: right
subject@update:
- label: system::lang.email_templates.subject
+ label: system::lang.mail_templates.subject
description:
- label: system::lang.email_templates.description
+ label: system::lang.mail_templates.description
type: textarea
size: tiny
@@ -35,9 +35,9 @@ secondaryTabs:
content_html:
type: richeditor
size: huge
- tab: system::lang.email_templates.content_html
+ tab: system::lang.mail_templates.content_html
content_text:
type: textarea
size: huge
- tab: system::lang.email_templates.content_text
\ No newline at end of file
+ tab: system::lang.mail_templates.content_text
\ No newline at end of file