Roundcube Community Forum

Third Party Contributions => Old Style Plug-Ins => Topic started by: paonza on October 10, 2006, 12:41:54 PM

Title: Email Notification
Post by: paonza on October 10, 2006, 12:41:54 PM
Hi All,
I have added 2 lines of code for manage the Email Notification when required...

go to program/steps/mail/show.inc

search:
// mark message as read
 if (!$MESSAGE['headers']->seen)
  $IMAP->set_flag($_GET['_uid'], 'SEEN');
should be at line 59
change to:
// mark message as read
 if (!$MESSAGE['headers']->seen)
 {
  $IMAP->set_flag($_GET['_uid'], 'SEEN');
  //notifica di lettura
  if ($MESSAGE['structure']->headers['disposition-notification-to'] != '')
  {
   mail($MESSAGE['structure']->headers['disposition-notification-to'], "Letto: ".$MESSAGE['structure']->headers['subject'], "Conferma messaggio inviato a\n".$MESSAGE['structure']->headers['to']." alle ".$MESSAGE['structure']->headers['date']."\n\nIl messaggio ÃÃ,¨ stato visualizzato nel computer del destinatario alle ".date('r',time()), "From: ".$MESSAGE['structure']->headers['to']);
   show_message($CONFIG['product_name']." ha inviato la Notifica di Lettura al Mittente.");
  }
 }

that's all... ;D

Enjoy!
Fabio
Title: Re: Email Notification
Post by: rockwilda on October 11, 2006, 04:51:18 AM
Ciao?

That is a cool hack. Thank you!

Can you please translate the italiano in english, because my italiano isn't very well?

greetz, Nico
Title: Re: Email Notification
Post by: paonza on October 11, 2006, 05:40:50 AM
yes... but check my bad english! :D
// mark message as read
 if (!$MESSAGE['headers']->seen)
 {
  $IMAP->set_flag($_GET['_uid'], 'SEEN');
  //notifica di lettura
  if ($MESSAGE['structure']->headers['disposition-notification-to'] != '')
  {
   mail($MESSAGE['structure']->headers['disposition-notification-to'], "Read: ".$MESSAGE['structure']->headers['subject'], "Message confirmation sent to\n".$MESSAGE['structure']->headers['to']." at ".$MESSAGE['structure']->headers['date']."\n\nThe message has been shown on the addressee's computer at ".date('r',time()), "From: ".$MESSAGE['structure']->headers['to']);
   show_message($CONFIG['product_name'].&quot; sent the <i>Read Notification</i> to the Addressee.&quot;);
  }
 }

ciao!
Fabio

[admin]Updated English ;)

FYI: Not a whole lot wrong. Just changed "Show" to "Shown"[/admin]
Title: Re: Email Notification
Post by: seansan on December 30, 2006, 01:56:24 PM

Poanza. I think this is great, but we need to add some functionality I think to make it even better.

Title: Re: Email Notification
Post by: Shadow aok on October 26, 2007, 05:58:25 AM
Updated version for RC2 (changes are only on the second and the fourth lines) with french language

// mark message as read
 if (!$MESSAGE['headers']->seen && $_action != 'preview')
 {
  $IMAP->set_flag($MESSAGE['UID'], 'SEEN');
  // Accusé de réception
  if ($MESSAGE['structure']->headers['disposition-notification-to'] != '')
  {
   mail($MESSAGE['structure']->headers['disposition-notification-to'], &quot;Lu: &quot;.$MESSAGE['structure']->headers['subject'], &quot;Accus&eacute; de r&eacute;ception
envoy&eacute; &agrave;\n&quot;.$MESSAGE['structure']->headers['to'].&quot; &agrave; &quot;.$MESSAGE['structure']->headers['date'].&quot;\n\nLe message a &eacute;t&eacute; re&ced
il;u par le destinataire &agrave; &quot;.date('r',time()), &quot;From: &quot;.$MESSAGE['structure']->headers['to']);
   show_message($CONFIG['product_name'].&quot; a envoy&eacute; l'<i>accus&eacute; de r&eacute;ception</i> &agrave; l'exp&eacute;diteur.&quot;);
  }
 }
Title: Re: Email Notification
Post by: rwilkins108 on November 01, 2007, 08:13:40 PM
So, what kind of notification does this mod do? is it a like a pop-up "you've got mail" ?
Title: Thanks
Post by: Roseladay123 on August 19, 2009, 11:23:13 PM
I'm glad this thread is made where I can gain a lot of useful and informative input.



comparatif simulation assurance vie multisupport (http://simulationassurancevie.com/) - simulation assurance vie ! Les sites de simulation assurance viecomparatif simulation assurance vie multisupport (http://simulationassurancevie.com/)