Guillermo - path get-mail-templates [skip ci]
This commit is contained in:
parent
fefe274d63
commit
1a600f4c61
|
@ -6,6 +6,7 @@ require_once 'system/add-department.php';
|
||||||
require_once 'system/edit-department.php';
|
require_once 'system/edit-department.php';
|
||||||
require_once 'system/delete-department.php';
|
require_once 'system/delete-department.php';
|
||||||
require_once 'system/get-logs.php';
|
require_once 'system/get-logs.php';
|
||||||
|
require_once 'system/get-mail-templates.php';
|
||||||
|
|
||||||
$systemControllerGroup = new ControllerGroup();
|
$systemControllerGroup = new ControllerGroup();
|
||||||
$systemControllerGroup->setGroupPath('/system');
|
$systemControllerGroup->setGroupPath('/system');
|
||||||
|
@ -17,5 +18,6 @@ $systemControllerGroup->addController(new AddDepartmentController);
|
||||||
$systemControllerGroup->addController(new EditDepartmentController);
|
$systemControllerGroup->addController(new EditDepartmentController);
|
||||||
$systemControllerGroup->addController(new DeleteDepartmentController);
|
$systemControllerGroup->addController(new DeleteDepartmentController);
|
||||||
$systemControllerGroup->addController(new GetLogsController);
|
$systemControllerGroup->addController(new GetLogsController);
|
||||||
|
$systemControllerGroup->addController(new GetMailTemplatesController);
|
||||||
|
|
||||||
$systemControllerGroup->finalize();
|
$systemControllerGroup->finalize();
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
use Respect\Validation\Validator as DataValidator;
|
||||||
|
|
||||||
|
class EditMailController extends Controller {
|
||||||
|
const PATH = '/edit-mail';
|
||||||
|
|
||||||
|
public function validations() {
|
||||||
|
return [
|
||||||
|
'permission' => 'staff_3',
|
||||||
|
'requestData' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handler() {
|
||||||
|
Response::respondSuccess();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
use Respect\Validation\Validator as DataValidator;
|
||||||
|
|
||||||
|
class GetMailTemplatesController extends Controller {
|
||||||
|
const PATH = '/get-mail-templates';
|
||||||
|
|
||||||
|
public function validations() {
|
||||||
|
return [
|
||||||
|
'permission' => 'staff_3',
|
||||||
|
'requestData' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handler() {
|
||||||
|
Response::respondSuccess(MailTemplate::getAll()->toArray());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
use Respect\Validation\Validator as DataValidator;
|
||||||
|
|
||||||
|
class RecoverMailTemplateController extends Controller {
|
||||||
|
const PATH = '/recover-mail-template';
|
||||||
|
|
||||||
|
public function validations() {
|
||||||
|
return [
|
||||||
|
'permission' => 'staff_3',
|
||||||
|
'requestData' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handler() {
|
||||||
|
Response::respondSuccess();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -46,4 +46,12 @@ class MailTemplate extends DataStore {
|
||||||
|
|
||||||
return $compiledString;
|
return $compiledString;
|
||||||
}
|
}
|
||||||
|
public function toArray() {
|
||||||
|
return [
|
||||||
|
'type' => $this->type,
|
||||||
|
'subject' => $this->subject,
|
||||||
|
'language' => $this->language,
|
||||||
|
'body' => $this->body,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue