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

Source for file x7iYhD98w_sendmail.php

Documentation is available at x7iYhD98w_sendmail.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage newsletter
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. /**
  12. * LogMailing()
  13. * 
  14. * @param string $string 
  15. * @return void 
  16. */
  17. function LogMailing($string)
  18. {
  19.     $fp = @fopen(LOG_MAILING, 'a');
  20.     @fwrite($fp, $string);
  21.     @fwrite($fp, END_LINE);
  22.     @fclose($fp);
  23. } 
  24.  
  25. include_once('../config/define.php');
  26. include_once('../config/server.php');
  27. include_once('../class/class.newsletter.php');
  28. include_once('../class/system/class.'.SQL.'.php');
  29. include_once("../lib/lib_common.php");
  30. include_once("../lib/functions_auth.php");
  31. include_once(SQL . '.inc.php');
  32.  
  33. set_time_limit(0); // suppression du timeout
  34.  
  35. $sql_entity = SQL;
  36. $sql_object = new $sql_entity;
  37. $sql_object->DBInitialise();
  38. $sql_object->DBConnexion();
  39. // sélection des newsletters à envoyer
  40. $newsletters = $sql_object->DBSelect(SQL_GetNewsletter2Send());
  41. if (count($newsletters) <= 1 && $newsletters[0] == false) exit;
  42.  
  43. // récupération des emails
  44. $emails_batch = $sql_object->DBSelect(SQL_GetEmails4Sending());
  45.  
  46. if (count($emails_batch) == 1 && $emails_batch[0] == false) exit;
  47.  
  48. $newsletter_object = new newsletter;
  49.  
  50. $path = $newsletter_object->URI_TEMPLATE;
  51.  
  52. // html
  53. $template_html = file_get_contents($path . '.html');
  54. // text
  55. $template_txt = file_get_contents($path . '.txt');
  56.  
  57.  
  58. $log_sep='##';
  59.  
  60. require("../mail/template_newsletter.php");
  61.  
  62.  
  63. ?>

Documentation generated on Fri, 16 Oct 2009 09:40:15 +0200 by phpDocumentor 1.4.1