linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file _ajax_send.php

Documentation is available at _ajax_send.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage newsletter
  5.  * @author Simon Georget <simon@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once('../lib/functions_auth.php');
  12. //////////// Check Droits utilisateur ////////////
  13. if (!IsSuperAdmin()) ReloadIndex('admin');
  14. ////////////
  15.  
  16. include_once('../config/define.php');
  17. include_once(themePath('../newsletter/'.SQL.'.inc.php'));
  18. include_once('../class/class.newsletter.php');
  19. include_once("../class/system/class.".SQL.".php");
  20. include_once('../languages/' U_L '/lang_newsletter.' CHARSET '.php');
  21.  
  22. ////////////////////////////////////////
  23. /// Connexion SQL
  24. ///////////////////
  25. include_once('../class/system/class.'.SQL.'.php');
  26. $sql_entity=SQL;
  27. $GLOBALS['sql_object'new $sql_entity;
  28. $GLOBALS['sql_object'-> DBInitialise();
  29. $GLOBALS['sql_object'-> DBConnexion();
  30. ///////////////////
  31.  
  32. if(is_numeric($_REQUEST['id']&& is_string($_REQUEST['user_email'])) {
  33.  
  34.   // preparing data
  35.   $emails_batch array(=> array('emailcol_id' => $user_id'emailcol_email' => $_REQUEST['user_email']));
  36.   $doNotPublish true// needed to keep the newsletter with open status
  37.   $newsletters $sql_object->DBSelect(SQL_getoneCompleteNewsLetter($_REQUEST['id']));
  38.   $newsletters[0]['newsletter_title'.= ' (' .  _t('newsletter''test_add'')';
  39.   
  40.   if (count($newsletters<= && $newsletters[0== false{
  41.     $status 0;
  42.     $o _t('newsletter''sent_failed');
  43.   }
  44.  
  45.   $newsletter_object new newsletter;
  46.   $path $newsletter_object->URI_TEMPLATE;
  47.  
  48.   // html
  49.   $template_html file_get_contents(themePath($path '.html'));
  50.   // text
  51.   $template_txt file_get_contents(themePath($path '.txt'));
  52.  
  53.   
  54.   require(themePath("../mail/template_newsletter.php"));
  55.   $status 1;
  56.   $o _t('newsletter''sent_successfully');
  57.   
  58.   /* Return json values */
  59.   echo json_encode(array('status'=> $status,'msg'=> $o));
  60. }
  61. ?>

Documentation generated on Thu, 03 May 2012 15:08:01 +0200 by phpDocumentor 1.4.1