w
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* API - Obtener plantillas de mensaje
|
||||
* Fecha: 13 de noviembre de 2025
|
||||
*/
|
||||
|
||||
require_once '../config/config.php';
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
|
||||
try {
|
||||
$db = Database::getInstance();
|
||||
|
||||
$templates = $db->fetchAll(
|
||||
"SELECT
|
||||
id,
|
||||
name,
|
||||
template_name,
|
||||
language_code,
|
||||
category,
|
||||
status,
|
||||
created_at
|
||||
FROM message_templates
|
||||
ORDER BY name ASC"
|
||||
);
|
||||
|
||||
echo json_encode($templates);
|
||||
|
||||
} catch (Exception $e) {
|
||||
error_log("Error in get_templates.php: " . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => 'Error interno del servidor']);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user