render_mail.php 708 B

12345678910111213141516171819202122232425
  1. <?php
  2. /* For license terms, see /license.txt */
  3. /**
  4. * Render an email from data
  5. * @package chamilo.plugin.advanced_subscription
  6. */
  7. /**
  8. * Init
  9. */
  10. require_once __DIR__.'/../config.php';
  11. $plugin = AdvancedSubscriptionPlugin::create();
  12. // Get validation hash
  13. $hash = Security::remove_XSS($_REQUEST['v']);
  14. // Get data from request (GET or POST)
  15. $data['queueId'] = intval($_REQUEST['q']);
  16. // Check if data is valid or is for start subscription
  17. $verified = $plugin->checkHash($data, $hash);
  18. if ($verified) {
  19. // Render mail
  20. $message = MessageManager::get_message_by_id($data['queueId']);
  21. $message = str_replace(array('<br /><hr>', '<br />', '<br/>'), '', $message['content']);
  22. echo $message;
  23. }