Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/spip/esqueleto-redcta/plugins/enviar_email/enviar_email_articulo.html

    r7 r30  
    22<BOUCLE_enviar_articulo(ARTICLES){id_article}>
    33<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    4 <html dir="#LANG_DIR" lang="#LANG">
     4<html dir="#LANG_DIR" lang="#LANG" style="background-color:#ffffff">
    55
    66<head>
     7
    78        <title>[Enviar artículo: (#TITRE|textebrut)]</title>
    8        
    9         <!-- Para los buscadores -->
    10         <meta http-equiv="Content-Type" content="text/html; charset=#CHARSET" />
    11         <meta name="robot" content="follow, index, all">
    12         <meta name="revisit-after" content="1 days">
    13         <meta name="generator" content="SPIP" />
    14         [<meta name="description" content="(#INTRODUCTION|couper{150}|attribut_html)" />]
    15         <meta name="keywords" content="">
    16 
     9        [<meta name="description" content="(#INTRODUCTION|couper{150}|textebrut)" />]
     10        <INCLURE{fond=inc-head}>
    1711
    1812<style type="text/css">
     
    2519
    2620.formulario {
    27         background-color: white;
     21        background-color:#ffffff;
    2822        border: 0px solid silver;
    29         font-family: Verdana, Arial, Helvetica, sans-serif;
    30         font-size:75%;
     23        font-size:90%;
    3124        margin-top:.9em;
    3225}
     
    3427.campos {
    3528        width: 95%;
     29        font-size:90%;
    3630        padding-left: 2px;
    3731        padding-right: 2px;
    38         padding-top:1px;
    39         padding-bottom:1px;
    40         font-size: 110%;
    41         color:#333333;
     32        padding-top:2px;
     33        padding-bottom:2px;
     34        font-family: Verdana, Arial, Helvetica, sans-serif;
     35        color:#666666;
    4236        margin-bottom:.3em;
    43         border:1px solid #B2BFCF;
     37        border:1px solid silver;
    4438}
    4539       
    46 .spip_bouton {
     40.boton {
    4741        padding: 0px;
    48         border: 1px solid gray;
    49         background-color: whitesmoke;
    50         font-family: verdana,helvetica,arial,sans-serif;
     42        border: 1px solid silver;
    5143        color: #666666;
    52         font-size: 100%;
    5344}
    5445-->
     
    5748</head>
    5849
    59 <body style="border:0px; padding:0px; text-align:center">
    60 #NOM_SITE
    61 <?php
     50<body style="border:0px; padding:0px; font-size:90%;text-align:center;background-color:#ffffff;color: #727860;">
     51
     52<?php
     53
    6254if (!$HTTP_POST_VARS){
    6355
     
    6557?>
    6658
    67 <div style="width:95%; margin:auto;">
     59<div style="width:90%; margin:auto;padding-top:.6em">
    6860  <form action="<?php $phpself; ?>" method="POST" enctype="multipart/form-data" class="formulario">
    69         <h2 style="text-align:center; margin-bottom:.2em"><span style="text-decoration:underline">#NOM_SITE_SPIP</span><div style="font-weight:normal; font-size:80%; margin-top:.6em;">Enviar [la referencia de "<span style="font-weight:bold; font-style: italic">(#TITRE)</span>" ]por correo electrónico</div></h2>
     61
     62<h2 style="text-align:center;"><span style="text-decoration:underline;color:#f28000">#NOM_SITE_SPIP</span><div style="font-weight:normal; font-size:80%; margin-top:.9em;margin-bottom:.9em">Enviar [referencia de <span style="font-weight:bold;font-style:italic">'(#TITRE)'</span> ]por correo electrónico</div></h2>
     63
    7064    <fieldset style="text-align:left; margin-bottom:.6em">
    7165   <b>Enviar a la dirección:</b><div style="font-size:95%;color:#999999">(separa con comas si escribes más de una)</div><input name="destino" class="campos" value="" size="40"></fieldset>
     
    7367       <legend style="font-weight:bold">Datos opcionales</legend>
    7468    Asunto <span style="font-size:95%;color:#999999">(título que quieres darle al mensaje)</span><br /><input name="asunto" class="campos" size="40" value=""><br/>
    75       Tu nombre<br /><input name="nombre" class="campos" size="40" value=""><br/>
     69Tu nombre<br /><input name="nombre" class="campos" size="40" value=""><br/>
    7670     Tu dirección de correo electrónico<br /><input name="email" class="campos" size="40" value=""><br />
    7771     Puedes añadir un texto en el mensaje<br /><textarea name="coment" class="campos" style="font-size:100%; font-family:verdana, arial, helvetica, sans-serif;" cols="40" rows="3"></textarea>
    7872     <div style="text-align:center">
    79       <input type="submit" name="enviar" class="spip_bouton" style="margin-top:.3em" value="Enviar">&nbsp;&nbsp;&nbsp;<input type="button"  class="spip_bouton" style="margin-top:.3em" value="Cancelar" onclick="window.close();">
     73      <input type="submit" name="enviar" class="boton" style="margin-top:.3em" value="Enviar">&nbsp;&nbsp;&nbsp;<input type="button"  class="boton" style="margin-top:.3em" value="Cancelar" onclick="window.close();">
    8074      </div>
    8175      <input type="hidden" name="message" value="1">
     
    8882
    8983// REVISA QUE HAYA UN EMAIL PARA ENVIAR EL MENSAJE
    90 if (!$destino) { echo "<p style='color:red; font-size:90%'>Lo sentimos :-(, pero sin dirección de correo electrónico válida no podemos enviar el mensaje</p>";
     84if (!$destino) { echo "<p style='color:red; font-size:90%'>Lo sentimos :-( pero sin dirección de correo electrónico válida<br />no podemos enviar el mensaje</p>";
    9185
    9286?>
     
    9488<div style="width:90%; margin:auto;">
    9589  <form action="<?php $phpself; ?>" method="POST" enctype="multipart/form-data" class="formulario">
    96         <h2 style="text-align:center; margin-bottom:.2em"><span style="text-decoration:underline">#NOM_SITE_SPIP</span><div style="font-weight:normal; font-size:80%; margin-top:.6em;">Enviar [la referencia de "<span style="font-weight:bold; font-style: italic">(#TITRE)</span>" ]por correo electrónico</div></h2>
     90        <h2 style="text-align:center; margin-bottom:.1em"><span style="text-decoration:underline">#NOM_SITE_SPIP</span><div style="font-weight:normal; font-size:80%; margin-top:1.2em">Enviar [referencia de <span style="font-weight:bold; font-style: italic">'(#TITRE)'</span> ]por correo electrónico</div></h2>
    9791    <fieldset style="text-align:left; margin-bottom:.6em">
    9892   <b>Enviar a la dirección:</b><div style="font-size:95%;color:#999999">(separa con comas si escribes más de una)</div><input name="destino" class="campos" value="" size="40"></fieldset>
     
    10094       <legend style="font-weight:bold">Datos opcionales</legend>
    10195    Asunto <span style="font-size:95%;color:#999999">(título que quieres darle al mensaje)</span><br /><input name="asunto" class="campos" size="40" value=""><br/>
    102       Tu nombre<br /><input name="nombre" class="campos" size="40" value=""><br/>
     96Tu nombre<br /><input name="nombre" class="campos" size="40" value=""><br/>
    10397     Tu dirección de correo electrónico<br /><input name="email" class="campos" size="40" value=""><br />
    10498     Puedes añadir un texto en el mensaje<br /><textarea name="coment" class="campos" style="font-size:100%; font-family:verdana, arial, helvetica, sans-serif;" cols="40" rows="3"></textarea>
    10599     <div style="text-align:center">
    106       <input type="submit" name="enviar" class="spip_bouton" style="margin-top:.3em" value="Enviar">&nbsp;&nbsp;&nbsp;<input type="button"  class="spip_bouton" style="margin-top:.3em" value="Cancelar" onclick="window.close();">
     100      <input type="submit" name="enviar" class="boton" style="margin-top:.3em" value="Enviar">&nbsp;&nbsp;&nbsp;<input type="button"  class="boton" style="margin-top:.3em" value="Cancelar" onclick="window.close();">
    107101      </div>
    108102     
     
    112106  </form>
    113107</div>
    114 <?php
    115 }else {
    116 
    117 // ENVÍO DEL MENSAJE CON PHPMAILER
     108
     109<?php
     110}
     111
     112// ENVIO DEL MENSAJE CON PHPMAILER
    118113
    119114include_spip("phpmailer/class.phpmailer");
     
    123118
    124119$mail->IsSMTP();
    125 $mail->Mailer = "mail";
    126 $mail->Host     = "localhost"; // Servidor de SMTP
     120$mail->Mailer = "smtp";
     121
     122
     123/*
     124// SI EL SERVIDOR DE SMTP REQUIERE AUTENTICACION RELLENA ESTOS DATOS CON LOS TUYOS Y ACTIVALO
     125
     126//Asignamos a Host el nombre de nuestro servidor smtp
     127  $mail->Host = "smtp.hotpop.com";
     128
     129  //Le indicamos que el servidor smtp requiere autenticación
     130  $mail->SMTPAuth = true;
     131
     132  //Le decimos cual es nuestro nombre de usuario y password
     133  $mail->Username = "micuenta@HotPOP.com";
     134  $mail->Password = "mipassword";
     135*/
     136 
     137$mail->Host = "localhost"; // Servidor de SMTP
    127138
    128139$mail->SetLanguage("es", "phpmailer/language/");
     
    130141$mail->Timeout="20";
    131142
    132 $mail->WordWrap = "75";                                 // set word wrap to 50 characters
    133 //$mail->AddAttachment("/var/tmp/file.tar.gz");         // añadir archivos
    134 $mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // añadir archivos con nombre
    135 
    136 // VARIABLES
    137 
    138 $un_salto="\r\n";
    139 $dos_saltos="\r\n\r\n";
     143// $mail->WordWrap = "50";                                 // set word wrap to 50 characters
     144// $mail->AddAttachment("/var/tmp/file.tar.gz");         // añadir archivos
     145// $mail->AddAttachment("#DOSSIER_SQUELETTE/imagenes/logo_64.jpg", "logo_64.jpg");    // añadir archivos con nombre
    140146
    141147// PARTE COMÚN
    142148
    143     //Estoy recibiendo los campos, compongo el cuerpo
     149  //Asignamos asunto y cuerpo del mensaje
     150 
     151      //Estoy recibiendo los campos, compongo el cuerpo
     152
     153    if (!$HTTP_POST_VARS["nombre"]) { $remite= "No ha escrito su nombre"; } else { $remite= $HTTP_POST_VARS["nombre"]; }
     154    $mail->FromName = $remite; // el nombre que queremos que vea
     155    $mail->From = $HTTP_POST_VARS["email"]; // el email del nombre que se ve
    144156   
    145     if (!$HTTP_POST_VARS["nombre"]) { $remite= "Olvidó escribir su nombre"; } else { $remite= $HTTP_POST_VARS["nombre"]; }
    146     $mail->FromName = $remite; // de nombre
    147     $mail->From = $HTTP_POST_VARS["nombre"]; // de email
    148    
    149         if (!$HTTP_POST_VARS["email"]) { $replica = "[(#EMAIL_WEBMASTER)]"; } else { $replica = $HTTP_POST_VARS["email"]; }
     157if (!$HTTP_POST_VARS["email"]) { $replica = '[(#EMAIL_WEBMASTER)]'; } else { $replica = $HTTP_POST_VARS["email"]; }
    150158        $mail->AddReplyTo($replica); // reply
    151159   
     
    155163                };
    156164       
    157     if (!$HTTP_POST_VARS["asunto"]) { $asunto="[(#TITRE|texte_script)]"; } else { $asunto=$HTTP_POST_VARS["asunto"]; }
     165    if (!$HTTP_POST_VARS["asunto"]) { $asunto='[(#TITRE|texte_script)]'; } else { $asunto=$HTTP_POST_VARS["asunto"]; }
    158166    $mail->Subject = $asunto; // Asunto
    159167
    160 // COMIENZO PARTE TEXTO PLANO
    161 
    162 //Referencia al artículo para el texto plano
    163 ?>
    164 
    165 <B_autores>
    166 <BOUCLE_autores(AUTEURS){id_article}{", "}>
    167 <?php $autores='#NOM'; ?>
    168 </BOUCLE_autores>
    169 <?php $autores="|de ".$autores; ?>
    170 </B_autores>
    171 
    172 <?php
    173         $articulo= "::: [(#TITRE|attribut_html)] :::".$un_salto;
    174         $articulo.= "[(#SURTITRE|attribut_html)|][(#SOUSTITRE|attribut_html)|][(#DATE|affdate)]".$autores.$dos_saltos;
    175         $articulo.= "[(#INTRODUCTION|attribut_html|textebrut|couper{360})]".$dos_saltos;
    176 
    177         if (!$HTTP_POST_VARS["coment"]) { $comentario="Hola. Quizás este artículo de #NOM_SITE_SPIP (#URL_SITE_SPIP) te pueda interesar."; } else { $comentario=$HTTP_POST_VARS["coment"]; }
    178     $texto_plano .= $dos_saltos.$comentario.$dos_saltos."-------------------------------".$dos_saltos;
    179     $texto_plano .= $articulo;
    180     ?>
    181 <B_documents_plano>
    182 <?php
    183 $texto_plano .="Si visitas el artículo podrás descargarte los siguientes documentos:".$un_salto;
    184 ?>
    185 <BOUCLE_documents_plano(DOCUMENTS) {id_article} {mode=document} {doublons}>
    186 <?php
    187 $texto_plano .="[- #TITRE, (#TYPE_DOCUMENT - (#TAILLE|taille_en_octets))]".$dos_saltos;
    188 ?>
    189 </BOUCLE_documents_plano>
    190 </B_documents_plano>
    191 
    192 <?php
    193         $texto_plano.= "* leerlo completo: #URL_SITE_SPIP/#URL_ARTICLE".$un_salto;
    194     $texto_plano .= $un_salto."-------------------------------".$un_salto."Mensaje enviado por: ".$remite." <".$replica.">".$un_salto;
    195     $texto_plano .= "Fuente: #NOM_SITE_SPIP (#URL_SITE_SPIP)";
    196     $texto_plano .= $un_salto."-------------------------------".$un_salto;
    197    
    198     $mail->AltBody = $texto_plano; //Cuerpo en TEXTO PLANO
    199    
    200 // FIN PARTE TEXTO PLANO
    201 
    202168// COMIENZO PARTE HTML
    203169
    204 $texto_html .="<div style='margin:1.2em;background: #fff;font-family:\'Trebuchet MS\', Tahoma, Arial, Verdana,sans-serif;font-size: 0.9em;text-align: left;'>";
    205         if (!$HTTP_POST_VARS["coment"]) { $comentario="Hola. Quizás este artículo de <a href='#URL_SITE_SPIP' style='text-decoration: none'>#NOM_SITE_SPIP</a> te pueda interesar."; } else { $comentario=$HTTP_POST_VARS["coment"]; }
    206 $texto_html .="<p>".$comentario."</p>";
    207 $texto_html .="<div style='border: 1px solid #ccc;padding: .5em;'>";
    208 $texto_html .="[<div style='font-size:1.1em;'><a href='#URL_SITE_SPIP/#URL_ARTICLE' style='text-decoration: none'>(#TITRE|supprimer_numero)</a></div>]";
    209 ?>
    210 
    211 <B_autores_html>
    212 <BOUCLE_autores_html(AUTEURS){id_article}{", "}>
    213 <?php $autores='[<a href="#URL_SITE_SPIP/#URL_AUTEUR" style="text-decoration:none">(#NOM)</a>]'; ?>
    214 </BOUCLE_autores_html>
    215 <?php $autores=" / de ".$autores; ?>
    216 </B_autores_html>
    217 
    218 <?php
    219 $texto_html .="<div style='color:#666666; font-size:90%;padding-bottom:.3em'>[(#SURTITRE|attribut_html) / ][(#SOUSTITRE|attribut_html) / ][(#DATE|affdate)]".$autores."</div>";
    220 $texto_html .="<div style='font-size:96%'>[(#CHAPO|attribut_html)]</div>";
    221 $texto_html .="<div style='font-size:96%'>[(#TEXTE|attribut_html)]</div>";
    222 $texto_html .=" <div style='color:#999999; font-size:90%;'>[<a href='#URL_SITE_SPIP/#URL_ARTICLE' style='text-decoration: none'>... leer m&aacute;s &rsaquo;&rsaquo;&rsaquo;</a>]</div>";
    223 ?>
    224 <B_documents>
    225 <?php
    226 $texto_html .="<div style='margin-top:.6em;padding:.3em; padding-bottom:0px;border-top:1px solid #cccccc;color:#666666; font-size:85%;'>Si visitas el artículo podrás descargarte los siguientes documentos:<br />";
    227 ?>
    228 <BOUCLE_documents(DOCUMENTS) {id_article} {mode=document} {doublons}>
    229 <?php
    230 $texto_html .="[&bull; #TITRE, (#TYPE_DOCUMENT - (#TAILLE|taille_en_octets))]";
    231 ?>
    232 </BOUCLE_documents>
    233 <?php
    234 $texto_html .="</div>";
    235 ?>
    236 </B_documents>
    237 <?php
    238 $texto_html .="</div>";
    239 $texto_html .= "<div style='margin-top:.2em;margin-bottom:.9em;color:#666666; font-size:80%;text-align:right'>Mensaje enviado por: ".$remite." <".$replica.">";
    240 $texto_html .= " /// Fuente: <a href='#URL_SITE_SPIP' style='text-decoration: none'>#NOM_SITE_SPIP</a><br /></div>";
    241 $texto_html .="</div>";
    242 
    243 $mail->Body    = $texto_html; //Cuerpo en HTML
    244 
    245 // FIN PARTE HTML
     170$sitio='[(#NOM_SITE_SPIP)]';
     171$url_sitio='[(#URL_SITE_SPIP)]';
     172$url_art='[(#URL_ARTICLE)]';
     173
     174$texto_html ="<div style='margin:1.2em;font-family:tahoma,verdana,arial,helvetica,sans-serif;background-color:#ffffff;color:#727860;border:1px solid #f28000'>";
     175
     176$texto_html.="<p style='padding:0px;margin:0px;text-align:left;font-size:120%;font-weight:bold;background-color:#f28000'><a href='$url_sitio' style='display:block;text-decoration:none;color:#edef9f;padding:.3em'><img src='logo_64.jpg' border='0' /> ".$sitio."</a></p>";
     177
     178$texto_html.="<div style='padding:.9em;padding-top:0px'>";
     179
     180if (!$HTTP_POST_VARS["coment"]) { $comentario="Hola. Quizás esta información te pueda interesar."; } else { $comentario=$HTTP_POST_VARS["coment"]; }
     181$texto_html.="<p style='text-align:left'>".$comentario."</p>";
     182
     183$texto_html.="<div style='border: 1px solid silver;background-color:whitesmoke'>";
     184$texto_html.="<div style='font-size:120%;padding:.3em;text-align:center;border-bottom:1px dotted silver'>".'[(#TITRE)]'."</div>";
     185$texto_html.="<div style='padding:.9em;padding-bottom:.3em;font-size:95%;'>".'[(#TEXTE|couper{1200})]'."</div>";
     186$texto_html.="<div style='font-size:90%;text-align:right;padding-bottom:.6em;padding-right:.9em'><a href='$url_sitio/$url_art'>leer más &rsaquo;&rsaquo;&rsaquo;</a></div>";
     187$texto_html.="</div>";
     188
     189if (!$HTTP_POST_VARS["email"]) { $email_aut=""; } else { $email_aut=" (".$HTTP_POST_VARS["email"].")"; }
     190$texto_html.="<div style='font-size:80%;color:#999999;text-align:left'>Envíado por: ".$remite.$email_aut."</div>";
     191
     192$texto_html.="</div></div>";
     193
     194$mail->Body = $texto_html;
     195 
     196// COMIENZO PARTE TEXTO PLANO
     197
     198if (!$HTTP_POST_VARS["coment"]) { $comentario="Hola. Quizás esta información te pueda interesar."; } else { $comentario=$HTTP_POST_VARS["coment"]; }
     199$texto_plano=$comentario."\n\n";
     200$texto_plano.="-------------------------- \n";
     201$texto_plano.='[(#NOM_SITE_SPIP)]'."\n".'[(#URL_SITE_SPIP)]'."\n\n";
     202$texto_plano.='[(#TITRE)]'."\n\n";
     203$texto_plano.='[(#TEXTE|couper{1200})]'."\n\n";
     204$texto_plano.="leer más: ".$url_sitio."/".$url_art."\n\n";
     205$texto_plano.="-------------------------- \n";
     206$texto_plano.="Envíado por: ".$remite.$email_aut;
     207
     208
     209  $mail->AltBody = $texto_plano;
     210 
     211// SE ENVÍA EL MENSAJE
    246212
    247213// Envío (5 intentos)
     
    263229if($enviado)
    264230{
    265 echo "<div style='margin-left:15px;margin-right:15px'><center><font color='#333366'><br /><br /><h2 style='text-align:center; font-weight:bold; margin-bottom:.3em'><span style='text-decoration:underline'>#NOM_SITE_SPIP</span></h2><br /><h1 style='text-align:center; font-size:90%'>La referencia de<i><b><div style='padding-top:.6em;padding-bottom:.6em'>\"[(#TITRE|texte_script)]\"</div></b></i>ya se ha enviado a ". $HTTP_POST_VARS["destino"] ."</h1></font></center></div>";
     231echo "<div style='margin-left:15px;margin-right:15px'><center><br /><br /><h2 style='text-align:center; font-weight:bold; margin-bottom:.6em'><span style='text-decoration:underline;color:#f28000'>".'[(#NOM_SITE_SPIP)]'."</span></h2><br /><h1 style='text-align:center;font-size:95%'>La referencia de<i><b><div style='padding-top:.9em;padding-bottom:.9em;font-size:115%'>\"".'[(#TITRE|texte_script)]'."\"</div></b></i><div style='padding-bottom:.6em'>ya se ha enviado a:</div>";
     232foreach($separar as $email_destino) { echo $email_destino."<br />"; }
     233echo "</h1 />";
    266234}
    267235else{
    268 echo "<div style='margin-left:15px;margin-right:15px'><center><font color='red'><br /><br /><h2 style='text-align:center; font-weight:bold; margin-bottom:.3em'><span style='text-decoration:underline'>#NOM_SITE_SPIP</span></h2><br /><h1 style='text-align:center; font-size:90%'>Lo sentimos<br />Ha habido un problema y no se ha podido enviar el correo :-(</h1></font></center></div>";
    269 }
    270 
    271 // Borro las direcciones de destino establecidas anteriormente
    272         $mail->ClearAddresses();
     236echo "<div style='margin-left:15px;margin-right:15px'><center><font color='red'><br /><br /><h2 style='text-align:center; font-weight:bold; margin-bottom:.3em'><span style='text-decoration:underline;color:#f28000'>".'[(#NOM_SITE_SPIP)]'."</span></h2><br /><h1 style='text-align:center;font-size:90%'>Lo sentimos<br />Ha habido un problema y no se ha podido enviar el correo :-(</h1></font></center></div>";
     237}
    273238
    274239?>
    275240
    276 <div style="text-align:center; font-size:90%">
     241<div style="text-align:center">
    277242<br />
    278 <input type="button"  class="spip_bouton" value="Cerrar" onclick="window.close();">
    279 </div>
    280 
    281 <?php
    282 }
     243<input type="button"  class="boton" value="Cerrar" onclick="window.close();">
     244</div>
     245
     246<?php
     247
    283248}
    284249?>
Note: See TracChangeset for help on using the changeset viewer.