List:Eventum General Discussion« Previous MessageNext Message »
From:Lauri Kuittinen Date:January 21 2010 9:30am
Subject:RE: Changing the way e-mails are sent (RE: Disabling the "issue
created" message)
View as plain text  
Hi David,

This almost works like a charm, it works for mail addresses that are eventum users, but if
I add an address unknown to eventum to the notification list, I get errors in running
process_mail_queue.php:

lauri@lauri-laptop:~$ /usr/bin/php -c/etc/php5/apache2/php.ini 
/var/www/eventum/misc/process_mail_queue.php
Warning: fwrite(): supplied argument is not a valid stream resource in
/var/www/eventum/include/class.error_handler.php on line 60
Warning: fwrite(): supplied argument is not a valid stream resource in
/var/www/eventum/include/class.error_handler.php on line 61
Warning: fclose(): supplied argument is not a valid stream resource in
/var/www/eventum/include/class.error_handler.php on line 62

And when I look at the database, I can see that the unknown address has disappeared,
maq_recipient field is added just as ",known-address@stripped".

You talked about removing recipient validation from somewhere, do you remember where that
was? This seems to be caused by just that.

--
Lauri

-----Original Message-----
From: David Anderson [mailto:david.anderson@stripped] 
Sent: 20. tammikuuta 2010 22:14
To: Lauri Kuittinen; Bryan Alsdorf
Cc: eventum-users@stripped
Subject: RE: Changing the way e-mails are sent (RE: Disabling the "issue created" message)

You could try the following (absolutely no guarantees it will work on your system).  I
cant remember whether I needed to remove some checks from elsewhere.

This is what we have done to merge mails together into a single to:

This is in the notifyNewEmail method at the bottom of that method, I have left the
original code in there as well for comparison.


// *** Dave A -  Merge emails into single $to

// *** Dave A - This is a method I use to configure whether to merge or not. You don't
need this method
		if (Support::isMergeEmail()){  
			foreach ($emails as $to){
				
			// Strip out email addresses	
				$arr1 = explode("<",$to);
				$arr2 = explode(">",$arr1[1]);
            	$to = $arr2[0];
                  // Merge emails into a single string
				$email_list = $email_list . $to . ', ';

			}	
//			$fixed_body =
Mail_API::addWarningMessage($issue_id, $email_list, $body, $headers);
                  $headers['To'] =
Mime_Helper::encodeAddress($email_list);
                  $mime = new Mail_mime("\r\n");
            
           	      Mail_Queue::add($email_list, $headers, $fixed_body, 1, $issue_id, $type,
$sender_usr_id, $sup_id); // *** Dave A - end email merge
		
}   else {    
// *** Dave A - original code to send individually to recipient

        foreach ($emails as $to) {
            $recipient_usr_id =
User::getUserIDByEmail(Mail_API::getEmailAddress($to));
            // add the warning message about replies being blocked or not
            $fixed_body = Mail_API::addWarningMessage($issue_id, $to, $body, $headers);
            $headers['To'] = Mime_Helper::encodeAddress($to);
            $mime = new Mail_mime("\r\n");
           	Mail_Queue::add($to, $headers, $fixed_body, 1, $issue_id, $type,
$sender_usr_id, $sup_id);
		}
		} 

Hope this helps

Dave


-----Original Message-----
From: Lauri Kuittinen [mailto:Lauri.Kuittinen@stripped]
Sent: Wednesday, 20 January 2010 9:20 p.m.
To: David Anderson; Bryan Alsdorf
Cc: eventum-users@stripped
Subject: RE: Changing the way e-mails are sent (RE: Disabling the "issue created" message)

Hi,

Thanks for your replies. I guessed it would be quite a complex change, considering how the
emails are handled now.

I would settle with the feature of adding a note on top of the message, but I think I
would need a little help with that, too :).

This is what I have so far: I assume I would have to edit include/class.notification.php ,
and the function notifyNewEmail. And I would probably be looking at the $fixed_body
variable.

But that's where me and my php skills face a wall, and where I would appreciate a little
help.

--
Lauri


-----Original Message-----
From: David Anderson [mailto:david.anderson@stripped]
Sent: 19. tammikuuta 2010 20:41
To: Bryan Alsdorf; Lauri Kuittinen
Cc: eventum-users@stripped
Subject: RE: Changing the way e-mails are sent (RE: Disabling the "issue created" message)

Hi,

I agree with Bryan - it is not an easy change to make and to do properly requires a
substantial (fundamental) change in the way emails and in particular recipients are
handled.  I have managed to make the change in my organisation however it is a bit of a
hack and I have had to remove recipient validation to make it work which is one reason
why I haven't contributed the code yet.  That and not enough time to strip out the
changes made.

Adding the recipient list into the body of the mail is a much easier short term solution.

I am hoping to work through this issue as it is a common request and fix/tidy up my code
but it will be a couple of months before I would be in a position to contribute the code.

Regards,
Dave

-----Original Message-----
From: Bryan Alsdorf [mailto:bryan@stripped]
Sent: Wednesday, 20 January 2010 5:54 a.m.
To: Lauri Kuittinen
Cc: eventum-users@stripped
Subject: Re: Changing the way e-mails are sent (RE: Disabling the "issue created" message)

Hi,

Lauri Kuittinen wrote:
> Hi,
> 
> Thanks for your help, I found the functions and now have the
functionality I want.
> 
> Now that we've had eventum in production for two days, I noticed some
more functionality I'm missing.
> 
> Whenever a user sends a message to the mailbox that eventum creates
issues from, there's often one or more other people in the To and Cc fields in our
environment.
> 
> Now, when we send a reply to an issue, eventum sends the email
notification to everyone in the notification list, one by one. And each user sees the
email notification like it was sent to them only, and they are not sure was the message
other people that were on the to and cc fields of the original message.
> 
> So my question is, would it be possible to change the way the emails
are sent one by one, so that they would be sent as one batch, all people who are on the
notification list would appear on the address fields. So that everyone would see who else
the email has been sent to. 

This would not be an easy change.

The some people have handled it in the past is having Eventum put a note at the top of
each message with the list of recipients. However this patch has not made it into the
main branch yet so you would have to add it yourself for now.

Best Regards,
--
Bryan Alsdorf, Lead Web Developer
Monty Program, AB. http://askmonty.org

--
Eventum Users Mailing List
For list archives: http://lists.mysql.com/eventum-users
To unsubscribe:
http://lists.mysql.com/eventum-users?unsub=1

Thread
Changing the way e-mails are sent (RE: Disabling the "issuecreated" message)Lauri Kuittinen19 Jan
  • Re: Changing the way e-mails are sent (RE: Disabling the "issue created"message)Bryan Alsdorf19 Jan
    • RE: Changing the way e-mails are sent (RE: Disabling the "issue created" message)David Anderson19 Jan
      • RE: Changing the way e-mails are sent (RE: Disabling the "issuecreated" message)Lauri Kuittinen20 Jan
        • RE: Changing the way e-mails are sent (RE: Disabling the "issue created" message)David Anderson20 Jan
          • Re: Changing the way e-mails are sent (RE: Disabling the "issue created" message)Tin Kyaw Oo21 Jan
          • RE: Changing the way e-mails are sent (RE: Disabling the "issuecreated" message)Lauri Kuittinen21 Jan
    • Email download problemTinkyawoo20 Jan
      • Re: Email download problemBryan Alsdorf20 Jan
RE: Changing the way e-mails are sent (RE: Disabling the "issuecreated" message)Lauri Kuittinen3 Feb