From 60a78290a9113f2c0078d2916e1cc82c1ec30195 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 6 Aug 2024 18:36:10 +0200 Subject: [PATCH] LSaddon::mail: fix handling the parameter of the sendMailFromTemplate function --- src/includes/addons/LSaddons.mail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/includes/addons/LSaddons.mail.php b/src/includes/addons/LSaddons.mail.php index 3d36cf51..06ff8282 100644 --- a/src/includes/addons/LSaddons.mail.php +++ b/src/includes/addons/LSaddons.mail.php @@ -403,7 +403,7 @@ function get_mail_template_saved_path($template, $extension) { /** * Send email from template * @param string $tplname The email template name - * @param string $to The email recipient + * @param string|array $to The email recipient(s) * @param array $variables Variables to use to compute the template * @param array|null $headers Email headers * @param array|null $attachments Email attachments as an array with @@ -431,6 +431,8 @@ function sendMailFromTemplate( if (is_array($variables)) array_map([$smarty, "assign"], array_keys($variables), array_values($variables)); + $to = ensureIsArray($to); + try { $subject = $smarty -> fetch("file:{$tpl['subject']}"); // Multiple line from subject cause problem, trim it and only the first line