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 <?php
include("Question.class.php");
$email = $_GET['email']; function mail_utf8($to, $subject = '(No subject)',
$subject = "[Nemubot] Confirmation d'inscription" $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"; $headers = "From: Nemubot <bot@nemunai.re>\n";
$message = "Bonjour,\n" $message = "Bonjour,\n"
."Vous avez demandé à être ajouté à la liste des participants " ."Vous avez demandé à être ajouté à la liste des participants "
@ -18,9 +28,7 @@ $message = "Bonjour,\n"
."Cordialement,\n\n" ."Cordialement,\n\n"
."-- \nNemubot"; ."-- \nNemubot";
$question = new Question(); if (mail_utf8($email, $subject, $message, $headers))
if ($question->mail_utf8($email, $subject, $message, $headers))
{ {
echo "email sent"; echo "email sent";
} }

View File

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