Fork me on GitHub

Rapport de message :*
 

Re: Notifications en HTML

Titre du sujet : Re: Notifications en HTML
par xoopeur sur 31/03/2008 10:13:52

Bon c nikel j'ai trouvé !

En fouillant un peu je suis tombé sur le fichier root/class/mail/phpmailer/class.phpmailer.php

J'ai remplacé text/plain par text/html

Citation :

/**
* Sets the Content-type of the message.
* @var string
*/
var $ContentType = "text/html";


La déjà après test ça à l'air de suffir pour envoyer des mails en html

Dans le fichier modules/news/submit.php
J'ai ajouté la ligne : $tags['HOMETEXT'] = $story->hometext();
Ici :
Citation :

// Notification
// TODO: modifier afin qu'en cas de prépublication, la notification ne se fasse pas
$notification_handler =& xoops_gethandler('notification');
$tags = array();
$tags['STORY_NAME'] = $story->title();
$tags['HOMETEXT'] = $story->hometext();
$tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();


ensuite j'ai modifié/customisé en html le fichier qui envoi les notifications d'un nouvel article :
news/language/french/mail_template/global_newstory_notify.tpl
en y ajoutant la variable (?) {HOMETEXT} pour avoir le scoop/résumé de mon article

Franchement.... bien ! sauf une bizzarerie :
Les images insérées en html dans le résumé/scoop de l'article à l'aide de la balise <img src...> ne s'affiche pas, alors que quand l'image est insérée en xoopscode elle apparaît bien... ?!

Peut-être bien que le problème se passe à cet endroit du fichier class.phpmailer.php que je ne suis pas sur de savoir correctement renseigner :

Citation :

/**
* Adds an embedded attachment. This can include images, sounds, and
* just about any other document. Make sure to set the $type to an
* image type. For JPEG images use "image/jpeg" and for GIF images
* use "image/gif".
* @param string $path Path to the attachment.
* @param string $cid Content ID of the attachment. Use this to identify
* the Id for accessing the image in an HTML form.
* @param string $name Overrides the attachment name.
* @param string $encoding File encoding (see $Encoding).
* @param string $type File extension (MIME) type.
* @return bool
*/
function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64",
$type = "images/jpeg") {

if(!@is_file($path))
{
$this->SetError($this->Lang("file_access") . $path);
return false;
}

$filename = basename($path);
if($name == "")
$name = $filename;


Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

16 Personne(s) en ligne (7 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 16 | Plus ...