Browse Source

Minor - WIP - add mail.ajax for the use of mail templates BT#14894

Julio Montoya 6 years ago
parent
commit
5769c197e3
1 changed files with 19 additions and 0 deletions
  1. 19 0
      main/inc/ajax/mail.ajax.php

+ 19 - 0
main/inc/ajax/mail.ajax.php

@@ -0,0 +1,19 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+require_once __DIR__.'/../global.inc.php';
+
+api_protect_admin_script();
+
+$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
+
+switch ($action) {
+    case 'select_option':
+        $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
+        $mail = new MailTemplateManager();
+        $item = $mail->get($id);
+        echo $item['template'];
+        break;
+}
+
+