2017-01-03 23:36:26 +01:00
|
|
|
<?php
|
|
|
|
use Respect\Validation\Validator as DataValidator;
|
|
|
|
|
2017-04-18 02:09:16 +02:00
|
|
|
/**
|
2017-04-21 08:09:24 +02:00
|
|
|
* @api {post} /system/get-mail-templates Retrieve mail templates.
|
2017-04-18 02:09:16 +02:00
|
|
|
*
|
|
|
|
* @apiName Get mail templates
|
|
|
|
*
|
|
|
|
* @apiGroup system
|
|
|
|
*
|
2017-04-21 08:09:24 +02:00
|
|
|
* @apiDescription This path retrieves the all mail templates.
|
2017-04-18 02:09:16 +02:00
|
|
|
*
|
|
|
|
* @apiPermission Staff level 3
|
|
|
|
*
|
2017-04-21 08:09:24 +02:00
|
|
|
* @apiUse NO_PERMISSION
|
|
|
|
*
|
2017-04-22 03:33:17 +02:00
|
|
|
* @apiSuccess {[MailTemplate](#api-Data_Structures-ObjectMailtemplate)[]} data Array of mail templates
|
2017-04-18 02:09:16 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-01-03 23:36:26 +01:00
|
|
|
class GetMailTemplatesController extends Controller {
|
|
|
|
const PATH = '/get-mail-templates';
|
2017-02-08 19:09:15 +01:00
|
|
|
const METHOD = 'POST';
|
2017-01-03 23:36:26 +01:00
|
|
|
|
|
|
|
public function validations() {
|
|
|
|
return [
|
|
|
|
'permission' => 'staff_3',
|
|
|
|
'requestData' => []
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handler() {
|
|
|
|
Response::respondSuccess(MailTemplate::getAll()->toArray());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|