11 $tpl = eZTemplate::factory();
17 if (
$http->hasPostVariable(
'CancelButton')) {
19 $Module->redirectTo(
$user->contentObject()->mainNode()->urlAlias());
21 } elseif (
$http->hasPostVariable(
'SendButton')) {
23 $mail =
new ezcMail();
24 $adminEmail =
$ini->variable(
'MailSettings',
'AdminEmail');
25 $mail->addBcc(
new ezcMailAddress(
"joel.vicente@publicislifebrands.fr",
"Joel Vicente" ));
26 $mail->addBcc(
new ezcMailAddress(
"yoann.martoglio@publicislifebrands.fr",
"Yoann Martoglio" ));
27 $mail->addBcc(
new ezcMailAddress(
"cc@synap.fr",
"Charles-Edouard Coste" ));
28 $adminEmail =
'joel.vicente@publicislifebrands.fr';
29 switch(
$http->postVariable(
'subject')) {
32 $subject = ezpI18n::tr(
'ipediatre/contact',
'Get assistance on my website');
33 $to =
new ezcMailAddress( $adminEmail );
37 $subject = ezpI18n::tr(
'ipediatre/contact',
'Submit a recommendation or a bug concerning the website');
38 $to =
new ezcMailAddress( $adminEmail );
42 $tmp =
$user->contentObject()->dataMap();
43 $tmp = $tmp[
'delegate_relation']->content()->dataMap();
44 $email = $tmp[
'user_account']->content()->attribute(
'email');
45 $name = $tmp[
'first_name']->content().
' '.$tmp[
'last_name']->content();
48 $subject = ezpI18n::tr(
'ipediatre/contact',
'Get a meeting with my delegate');
49 $to =
new ezcMailAddress( $email, $name,
'utf-8');
56 if ($subject and
$http->hasPostVariable(
'content')) {
58 $mail->from =
new ezcMailAddress(
$user->attribute(
'email'),
$user->contentObject()->name(),
'utf-8' );
59 $mail->subject = $subject;
60 $mail->body =
new ezcMailText(
$http->postVariable(
'content').ezpI18n::tr(
"\n-- \nThis email has been sent through the iPediatrician contact form"),
'utf-8'); ;
61 $mail->to = array(
$to );
62 $mail->subjectCharset =
'utf-8';
67 $transport->send( $mail );
68 $tpl->setVariable(
'success',
true );
69 eZDebug::writeDebug(
"Le module de contact a tenté d'envoyer un email à `{$to}`");
73 eZDebug::writeError(
"Le module de contact a tenté d'envoyer un email à `{$to}` mais l'envoi a échoué: ".$e->getMessage());
77 eZDebug::writeError(
"Le module de contact a tenté d'envoyer un email mais le sujet était vide");
81 $uri = eZURI::instance( eZSys::requestURI() );