opensupports/server/controllers/system/get-mail-templates.php

36 lines
804 B
PHP
Raw Normal View History

<?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
*
*/
class GetMailTemplatesController extends Controller {
const PATH = '/get-mail-templates';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'staff_3',
'requestData' => []
];
}
public function handler() {
Response::respondSuccess(MailTemplate::getAll()->toArray());
}
}