From 6b91a226ba4f62cdb27b50db978b479b92247a84 Mon Sep 17 00:00:00 2001
From: Nicolas Bouilleaud <nico@bou.io>
Date: Mon, 15 Apr 2019 17:21:40 +0200
Subject: [PATCH] Set the MailService Charset before setting the body

msgHTML builds the text/plain part by converting the passed html to text in the current CharSet; the default Charset being iso-8859-1, most non-ascii characters are lost.

fixes #416
---
 app/classes/Framadate/Services/MailService.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/classes/Framadate/Services/MailService.php b/app/classes/Framadate/Services/MailService.php
index ce8aa0bc..83564ba9 100644
--- a/app/classes/Framadate/Services/MailService.php
+++ b/app/classes/Framadate/Services/MailService.php
@@ -68,10 +68,10 @@ class MailService {
             // Bodies
             $body = $body . ' <br/><br/>' . __('Mail', 'Thank you for your trust.') . ' <br/>' . NOMAPPLICATION . ' <hr/>' . __('Mail', "\"The road is long, but the way is clear…\"<br/>Framasoft lives only by your donations.<br/>Thank you in advance for your support https://soutenir.framasoft.org");
             $mail->isHTML(true);
+            $mail->CharSet = 'utf-8';
             $mail->msgHTML($body, ROOT_DIR, true);
 
             // Build headers
-            $mail->CharSet = 'UTF-8';
             $mail->addCustomHeader('Auto-Submitted', 'auto-generated');
             $mail->addCustomHeader('Return-Path', '<>');
 
-- 
GitLab