Skip to content
Snippets Groups Projects
Commit 36fd1608 authored by pyg77's avatar pyg77
Browse files

les mails de création de sondages sont maintenant envoyés avec un reply-to...

les mails de création de sondages sont maintenant envoyés avec un reply-to configuré sur l'adresse du créateur du sondage et un from qui n'est pas obligatoirement l'adresse de l'admin de l'application
parent 0a93fe8e
No related branches found
No related tags found
No related merge requests found
......@@ -116,8 +116,8 @@ function ajouter_sondage()
$message_admin = sprintf($message_admin, getUrlSondage($sondage_admin, true));
if (validateEmail($_SESSION['adresse'])) {
sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin );
sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message );
sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $_SESSION['adresse'] );
sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] );
}
$date=date('H:i:s d/m/Y:');
......
......@@ -168,10 +168,20 @@ function sendEmail( $to, $subject, $body, $headers, $param)
} else {
$folding = "" ;
} ;
// si $headers ne contient qu'une adresse email, on la considère comme adresse de reply-to, sinon on met l'adresse de no-reply definie dans variables.php
if (validateEmail($headers)) {
$replyTo = $headers;
$headers = ""; // on reinitialise $headers
} else {
$replyTo = ADRESSEEMAILREPONSEAUTO;
}
$from = sprintf( "From: %s%s <%s>\n", $encoded_app, $folding, ADRESSEMAILADMIN ) ;
if ( $headers ) $headers .= "\n" ;
$headers .= $from ;
$headers .= "Reply-To: $replyTo\n";
$headers .= "MIME-Version: 1.0\n" ;
$headers .= "Content-Type: text/plain; charset=UTF-8\n" ;
$headers .= "Content-Transfer-Encoding: 8bit" ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment