Fix email for subscription and change style when confirmation

This commit is contained in:
Bertrand 2012-06-15 10:11:48 +02:00
parent 1bdda247a3
commit 65670dd09d
2 changed files with 18 additions and 9 deletions

View File

@ -1,9 +1,19 @@
<?php
include("Question.class.php");
$email = $_GET['email'];
$subject = "[Nemubot] Confirmation d'inscription"
function mail_utf8($to, $subject = '(No subject)',
$message = '', $header = '')
{
$header_ = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/plain; charset=UTF-8' . "\r\n";
return (mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=',
$message, $header_ . $header));
}
$email = $_POST['email'];
echo $email;
$subject = "[Nemubot] Confirmation d'inscription";
$headers = "From: Nemubot <bot@nemunai.re>\n";
$message = "Bonjour,\n"
."Vous avez demandé à être ajouté à la liste des participants "
@ -11,16 +21,14 @@ $message = "Bonjour,\n"
."Si c'est le cas, vous pouvez cliquer sur le lien suivant "
."pour confirmer :\n"
. "http://".$_SERVER["SERVER_NAME"]
. dirname($_SERVER["REQUEST_URI"]) . "subscribeConfirmation.php"
. "http://".$_SERVER["SERVER_NAME"]
. dirname($_SERVER["REQUEST_URI"]) . "subscribeConfirmation.php"
."\n\n Si ce n'est pas le cas, merci de supprimer cet email\n"
."Cordialement,\n\n"
."-- \nNemubot";
$question = new Question();
if ($question->mail_utf8($email, $subject, $message, $headers))
if (mail_utf8($email, $subject, $message, $headers))
{
echo "email sent";
}

View File

@ -25,6 +25,7 @@
<h1>Nemubot Questions (BETA)</h1>
</div>
</header>
<section id="introduction">
<article id="validate">
<h2>Merci de votre participation!</h2>
<p>
@ -43,6 +44,6 @@
<a href="index.html">Proposer une nouvelle question</a>
</p>
</article>
</section>
</body>
</html>