From 0ba31934d7435e23dfe556b5a18c89ea5344ecf1 Mon Sep 17 00:00:00 2001
From: Henri-Damien LAURENT <hdlaurent@afi-sa.net>
Date: Mon, 28 Aug 2023 13:02:42 +0000
Subject: [PATCH] hotline#184166 : Newsletter : Error when sending newsletters

---
 VERSIONS_HOTLINE/184166    | 1 +
 scripts/sendNewsletter.php | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 VERSIONS_HOTLINE/184166

diff --git a/VERSIONS_HOTLINE/184166 b/VERSIONS_HOTLINE/184166
new file mode 100644
index 00000000000..0e0637b1d9d
--- /dev/null
+++ b/VERSIONS_HOTLINE/184166
@@ -0,0 +1 @@
+ - correctif #184166 : Lettre d'information : Résolution d'un souci d'envoi des lettres d'information
\ No newline at end of file
diff --git a/scripts/sendNewsletter.php b/scripts/sendNewsletter.php
index 97f01911b9d..154415cf123 100644
--- a/scripts/sendNewsletter.php
+++ b/scripts/sendNewsletter.php
@@ -26,12 +26,10 @@ $dispatch_id = $argv[4];
 
 require_once 'includes.php';
 
-$_SERVER['DOCUMENT_ROOT'] = (new Storm_FileSystem_Disk)->getcwd();
-
 $bokeh = (new Bokeh_Engine())->warmUp();
 if ('test' != $dispatch_id
     && (!$dispatch = Class_Newsletter_Dispatch::find($dispatch_id))) {
-  printf("Unkown dispatch %s\n", $dispatch_id);
+  printf("Unknown dispatch %s\n", $dispatch_id);
   exit(1);
 }
 
@@ -48,5 +46,7 @@ register_shutdown_function($my_shutdown);
 
 $bokeh->powerOn();
 
+$_SERVER['DOCUMENT_ROOT'] = (new Storm_FileSystem_Disk)->getcwd();
+
 if ($dispatch)
   $dispatch->sendBy(20);
-- 
GitLab