diff --git a/server/controllers/system.php b/server/controllers/system.php index b815bca7..5e719e16 100644 --- a/server/controllers/system.php +++ b/server/controllers/system.php @@ -6,6 +6,7 @@ require_once 'system/add-department.php'; require_once 'system/edit-department.php'; require_once 'system/delete-department.php'; require_once 'system/get-logs.php'; +require_once 'system/get-mail-templates.php'; $systemControllerGroup = new ControllerGroup(); $systemControllerGroup->setGroupPath('/system'); @@ -17,5 +18,6 @@ $systemControllerGroup->addController(new AddDepartmentController); $systemControllerGroup->addController(new EditDepartmentController); $systemControllerGroup->addController(new DeleteDepartmentController); $systemControllerGroup->addController(new GetLogsController); +$systemControllerGroup->addController(new GetMailTemplatesController); $systemControllerGroup->finalize(); \ No newline at end of file diff --git a/server/controllers/system/edit-mail-templates.php b/server/controllers/system/edit-mail-templates.php new file mode 100644 index 00000000..a6e26b60 --- /dev/null +++ b/server/controllers/system/edit-mail-templates.php @@ -0,0 +1,18 @@ + 'staff_3', + 'requestData' => [] + ]; + } + + public function handler() { + Response::respondSuccess(); + + } +} \ No newline at end of file diff --git a/server/controllers/system/get-mail-templates.php b/server/controllers/system/get-mail-templates.php new file mode 100644 index 00000000..b0d0a46a --- /dev/null +++ b/server/controllers/system/get-mail-templates.php @@ -0,0 +1,18 @@ + 'staff_3', + 'requestData' => [] + ]; + } + + public function handler() { + Response::respondSuccess(MailTemplate::getAll()->toArray()); + + } +} \ No newline at end of file diff --git a/server/controllers/system/recover-mail-template.php b/server/controllers/system/recover-mail-template.php new file mode 100644 index 00000000..772a512d --- /dev/null +++ b/server/controllers/system/recover-mail-template.php @@ -0,0 +1,18 @@ + 'staff_3', + 'requestData' => [] + ]; + } + + public function handler() { + Response::respondSuccess(); + + } +} \ No newline at end of file diff --git a/server/models/MailTemplate.php b/server/models/MailTemplate.php index 55ad8a8e..a2931061 100644 --- a/server/models/MailTemplate.php +++ b/server/models/MailTemplate.php @@ -46,4 +46,12 @@ class MailTemplate extends DataStore { return $compiledString; } + public function toArray() { + return [ + 'type' => $this->type, + 'subject' => $this->subject, + 'language' => $this->language, + 'body' => $this->body, + ]; + } } \ No newline at end of file