Author Topic: Email Notification  (Read 10314 times)

Offline paonza

  • Newbie
  • *
  • Posts: 5
Email Notification
« 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:
Code: [Select]
// mark message as read
 if (!$MESSAGE['headers']->seen)
  $IMAP->set_flag($_GET['_uid'], 'SEEN');
should be at line 59
change to:
Code: [Select]
// 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

Offline rockwilda

  • Jr. Member
  • **
  • Posts: 35
Re: Email Notification
« Reply #1 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

Offline paonza

  • Newbie
  • *
  • Posts: 5
Re: Email Notification
« Reply #2 on: October 11, 2006, 05:40:50 AM »
yes... but check my bad english! :D
Code: [Select]
// 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]

Offline seansan

  • Jr. Member
  • **
  • Posts: 84
Re: Email Notification
« Reply #3 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.

  • We should add a global variable to set / unset / warn (popup asking per e-mail)
  • I had a look at the code and I could not find the disposition-notification-to header in the headers of the e-mail -> used print_r($MESSAGE['structure'])
    • A broader check should be done to find out who to reply to as 1. notification to, 2. reply-to and then 3. the sender

    Does anyone know how to correctly capture the disposition-notification-to header? (maybe I did something wrong, but could not access this var)

Offline Shadow aok

  • Jr. Member
  • **
  • Posts: 12
Re: Email Notification
« Reply #4 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

Code: [Select]
// 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;);
  }
 }

Offline rwilkins108

  • Jr. Member
  • **
  • Posts: 21
Re: Email Notification
« Reply #5 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" ?

Roseladay123

  • Guest
Thanks
« Reply #6 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 - simulation assurance vie ! Les sites de simulation assurance viecomparatif simulation assurance vie multisupport