From 13577d8d48b30cd3b648a541f54eee455e067d0c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 30 Nov 2019 19:52:06 +0100 Subject: [PATCH 1/2] FIX #12473 --- scripts/emailings/mailing-send.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 0e161a9c9cc..f4d3ab08802 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,6 +91,8 @@ if ($resql) { $emailing = new Mailing($db); $emailing->fetch($obj->rowid); + $upload_dir = $conf->mailing->dir_output . "/" . get_exdir($emailing->id, 2, 0, 1, $emailing, 'mailing'); + $id = $emailing->id; $subject = $emailing->sujet; $message = $emailing->body; @@ -228,9 +231,25 @@ if ($resql) { $substitutionisok = true; + $arr_file = array(); + $arr_mime = array(); + $arr_name = array(); + $arr_css = array(); + + $listofpaths=dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0); + + if (count($listofpaths)) + { + foreach($listofpaths as $key => $val) + { + $arr_file[]=$listofpaths[$key]['fullname']; + $arr_mime[]=dol_mimetype($listofpaths[$key]['name']); + $arr_name[]=$listofpaths[$key]['name']; + } + } // Fabrication du mail $trackid = 'emailing-' . $obj->fk_mailing . '-' . $obj->rowid; - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, array(), array(), array(), '', '', 0, $msgishtml, $errorsto, '', $trackid, '', 'emailing'); + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing'); if ($mail->error) { $res = 0; From 66571df449bac021d2f9fabd8eb5b15dd414994f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Dec 2019 15:19:14 +0100 Subject: [PATCH 2/2] Fix remove a link that is private --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c45688b3557..ece9f4b3d06 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1125,7 +1125,7 @@ TriggerAlwaysActive=Triggers in this file are always active, whatever are the ac TriggerActiveAsModuleActive=Triggers in this file are active as module %s is enabled. GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords. DictionaryDesc=Insert all reference data. You can add your values to the default. -ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting. For a full list of the parameters available see here. +ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting only. MiscellaneousDesc=All other security related parameters are defined here. LimitsSetup=Limits/Precision setup LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here