From 45d14044f8fe6fd935dfcb2241eb594a9095ce4a Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Tue, 14 Apr 2015 22:32:41 +0200 Subject: [PATCH] Factorize a little the mails --- app/classes/Framadate/Services/MailService.php | 4 ++-- create_classic_poll.php | 4 ++-- create_date_poll.php | 4 ++-- locale/fr.json | 2 +- studs.php | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/classes/Framadate/Services/MailService.php b/app/classes/Framadate/Services/MailService.php index 3c445ec..2b7dd66 100644 --- a/app/classes/Framadate/Services/MailService.php +++ b/app/classes/Framadate/Services/MailService.php @@ -14,7 +14,7 @@ class MailService { } function send($to, $subject, $body, $param = '') { - if($this->smtp_allowed == true) { + if ($this->smtp_allowed == true) { mb_internal_encoding('UTF-8'); $subject = mb_encode_mimeheader(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'), 'UTF-8', 'B', "\n", 9); @@ -39,7 +39,7 @@ class MailService { $headers .= "Auto-Submitted:auto-generated\n"; $headers .= 'Return-Path: <>'; - $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8') . __('Mail', 'FOOTER'); + $body = $body . '

' . __('Mail', 'Thanks for your trust.') . '
' . NOMAPPLICATION . '
' . __('Mail', 'FOOTER'); mail($to, $subject, $body, $headers, $param); } diff --git a/create_classic_poll.php b/create_classic_poll.php index 6e64e8f..f39c9af 100644 --- a/create_classic_poll.php +++ b/create_classic_poll.php @@ -99,10 +99,10 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ( $message = __('Mail', "This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); $message .= '

'; $message .= Utils::htmlEscape($_SESSION['form']->admin_name) . ' ' . __('Mail', 'hast just created a poll called') . ' : "' . Utils::htmlEscape($_SESSION['form']->title, ENT_QUOTES) . '".
'; - $message .= __('Mail', 'Thanks for filling the poll at the link above') . ' :

%s

' . __('Mail', 'Thanks for your trust.') . '
' . NOMAPPLICATION; + $message .= __('Mail', 'Thanks for filling the poll at the link above') . ' :

%s'; $message_admin = __('Mail', "This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); - $message_admin .= ' :

%s

' . __('Mail', 'Thanks for your trust.') . '
' . NOMAPPLICATION; + $message_admin .= ' :

%s'; $message = sprintf($message, Utils::getUrlSondage($poll_id)); $message_admin = sprintf($message_admin, Utils::getUrlSondage($admin_poll_id, true)); diff --git a/create_date_poll.php b/create_date_poll.php index beb3f2a..2cffcda 100644 --- a/create_date_poll.php +++ b/create_date_poll.php @@ -97,10 +97,10 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) || $message = __('Mail', "This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); $message .= '

'; $message .= Utils::htmlEscape($_SESSION['form']->admin_name) . ' ' . __('Mail', 'hast just created a poll called') . ' : "' . Utils::htmlEscape($_SESSION['form']->title) . '".
'; - $message .= __('Mail', 'Thanks for filling the poll at the link above') . ' :

%s

' . __('Mail', 'Thanks for your trust.') . '
' . NOMAPPLICATION; + $message .= __('Mail', 'Thanks for filling the poll at the link above') . ' :

%s'; $message_admin = __('Mail', "This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); - $message_admin .= ' :

%s

' . __('Mail', 'Thanks for your trust.') . '
' . NOMAPPLICATION; + $message_admin .= ' :

%s'; $message = sprintf($message, Utils::getUrlSondage($poll_id)); $message_admin = sprintf($message_admin, Utils::getUrlSondage($admin_poll_id, true)); diff --git a/locale/fr.json b/locale/fr.json index 81f23b6..0161f3c 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -291,7 +291,7 @@ "updated a vote.\nYou can find your poll at the link": "vient de mettre à jour un vote.
Vous pouvez retrouver votre sondage avec le lien suivant", "wrote a comment.\nYou can find your poll at the link": "vient de rédiger un commentaire.
Vous pouvez retrouver votre sondage avec le lien suivant", "Thanks for your trust.": "Merci de votre confiance.", - "FOOTER": "

« La route est longue, mais la voie est libre… »
Framasoft ne vit que par vos dons (déductibles des impôts).
Merci d'avance pour votre soutien http://soutenir.framasoft.org.", + "FOOTER": "« La route est longue, mais la voie est libre… »
Framasoft ne vit que par vos dons (déductibles des impôts).
Merci d'avance pour votre soutien http://soutenir.framasoft.org.", "[ADMINISTRATOR] New settings for your poll": "[ADMINISTRATEUR] Changement de configuration du sondage", "You have changed the settings of your poll. \nYou can modify this poll with this link": "Vous avez modifié la configuration de votre sondage.
Vous pouvez modifier ce sondage avec le lien suivant", "This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.": "Ceci est le message qui doit être envoyé aux sondés.
Vous pouvez maintenant transmettre ce message à toutes les personnes susceptibles de participer au vote.", diff --git a/studs.php b/studs.php index b13c033..f5a1a8f 100644 --- a/studs.php +++ b/studs.php @@ -81,7 +81,6 @@ function sendUpdateNotification($poll, $mailService, $name, $type) { break; } $message .= Utils::getUrlSondage($poll->admin_id, true) . "\n\n"; - $message .= __('Mail', 'Thanks for your trust.') . "\n" . NOMAPPLICATION; $mailService->send($poll->admin_mail, $subject, $message);