Author Topic: Add a Prefix to mail Notifications Subject  (Read 2600 times)

glueball

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Add a Prefix to mail Notifications Subject
« on: February 19, 2009, 11:02:58 AM »
Hi all,
We have made a change, adding a prefix to the subject line to facilitate filtering on our mail clients. I believe this would be a nice thing to have for more people. The way it was done might not be the best, but here it is:
(1.2 RC2):
config/config.php adedd:
define('MAIL_PREPEND','[OpenGoo] - ');

application/models/notifier/
Changed:
 Notifier.class.php:551:         $result = $mailer->send($to, $from, MAIL_PREPEND.$subject, $body, $type, $encoding);

Kyriacos

-with apologies if someone already did/posted about something similar

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Add a Prefix to mail Notifications Subject
« Reply #1 on: February 19, 2009, 12:58:32 PM »
Good idea. If more people request it we will include it on the official release.

rx2

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Add a Prefix to mail Notifications Subject
« Reply #2 on: February 19, 2009, 05:54:28 PM »
We'd love to see the Workspace in the subject line. Is there a quick way to do that?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Add a Prefix to mail Notifications Subject
« Reply #3 on: February 23, 2009, 07:57:28 PM »
It's not easy, because some objects can have multiple workspaces and others have only one workspace. For objects that can have more than one workspace you may have some security issues, as you may be showing to some users workspaces that they shouldn't know about.

Technically though, it can be done by adding a couple lines of code.

glueball

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Add a Prefix to mail Notifications Subject
« Reply #4 on: February 24, 2009, 05:27:58 AM »
Our original idea was to simply provide a way to do filtering in our mail clients, the inclusion of other elements, in a sense is a different modification.

With regards to the security issue of multiple Worspaces that could possibly be handled by sending only the "current" workspace, that is the workspace in which the user was in when the email alert was triggered.

Of course I am not that familiar with the code so the above could be wrong/hard/nonsense.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Add a Prefix to mail Notifications Subject
« Reply #5 on: February 24, 2009, 05:20:11 PM »
The problem with using the current workspace is that it can be 'All' or any parent workspace of the workspace where the object lies, so in many cases you won't be able to tell from which workspace the notification was triggered.

 

anything
anything