11 $tpl = eZTemplate::factory();
16 if (
$http->hasPostVariable(
'CancelButton')) {
18 $Module->redirectTo(
$user->contentObject()->mainNode()->urlAlias());
20 } elseif (
$http->hasPostVariable(
'SendButton')) {
22 $mail =
new ezcMail();
24 if(
$http->postVariable(
'email')) {
26 $subject = ezpI18n::tr(
'ipediatre/contact',
'You pediatrician wants to share his URL with you');
27 $to =
new ezcMailAddress(
$http->postVariable(
'email') );
31 if (
$http->hasPostVariable(
'content')) {
33 $mail->from =
new ezcMailAddress(
$user->attribute(
'email'),
$user->contentObject()->name(),
'utf-8' );
34 $mail->subject = $subject;
35 $mail->body =
new ezcMailText(
$http->postVariable(
'content').
" ",
'utf-8');
36 $mail->to = array(
$to );
37 $mail->subjectCharset =
'utf-8';
42 $transport->send( $mail );
43 $tpl->setVariable(
'success',
true );
44 $Module->redirectTo(
$user->contentObject()->mainNode()->urlAlias());
48 eZDebug::writeError(
"Le module de partage d'url a tenté d'envoyer un email à `{$to}` mais l'envoi a échoué: ".$e->getMessage());
52 eZDebug::writeError(
"Le module de partage d'url a tenté d'envoyer un email mais le sujet était vide");
56 $uri = eZURI::instance( eZSys::requestURI() );
59 $tpl->setVariable(
'login',
'nutrition');
60 $tpl->setVariable(
'password',
'nutrition');
61 $tpl->setVariable(
'url',
'http://' . $_SERVER[
"HTTP_HOST"] .
'/' .
$user->contentObject()->mainNode()->urlAlias());
62 $tpl->setVariable(
'name',
$user->contentObject()->name());