render_mail.php 709 B

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