Author Topic: Subscription notifications for tasks and milestones  (Read 2824 times)

nonsequitur

  • Newbie
  • *
  • Posts: 8
    • View Profile
Subscription notifications for tasks and milestones
« on: August 25, 2009, 11:56:35 am »
I have a few users set up as subscribers on tasks and milestones, however they are not getting updates when something is completed or when a comment is added to the task/milestone.

I've had to modify the Notifier.class.php script due to godaddy not playing nice with the swift libraries.  I note the change below, but the emailer works for password updates, welcome messages,  and the test mail script also works.
Code: [Select]
static function sendEmail($to, $from, $subject, $body = false, $type = 'text/plain', $encoding = '8bit') {
return mail($to,$subject,$body,'From: company name <'.$from.'>\r\n');
} // sendEmail

does anyone know what might explain this behavior?  i'm on og 1.5.2

nonsequitur

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Subscription notifications for tasks and milestones
« Reply #1 on: August 26, 2009, 11:25:38 am »
after further review, og sends the to field as an array, and the mailer doesn't like that.  I guess i'll have to come up with a way arround it.

I can't get the smtp settings nor the "standard" php settings to work.

Edit:  I think i'm close, but the syntax is escaping me:
Code: [Select]
static function sendEmail($to, $from, $subject, $body = false, $type = 'text/plain', $encoding = '8bit') {
if(is_array($to)) {
foreach($to as $sendto) {
return mail($sendto,$subject,$body,'From: Company name<'.$from.'>\r\n');
} //foreach
} else {
return mail($to,$subject,$body,'From: Company name <'.$from.'>\r\n');
} //if
} // sendEmail
« Last Edit: August 26, 2009, 01:05:58 pm by nonsequitur »

nonsequitur

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Subscription notifications for tasks and milestones
« Reply #2 on: August 26, 2009, 10:59:49 pm »
One step forward, and one step back.

I've gotten reworked the send mail script to work for godaddy,  it is the following script:
/opengoo/application/models/notifier/Notifier.class.php
Code: [Select]
static function sendEmail($to, $from, $subject, $body = false, $type = 'text/plain', $encoding = '8bit') {
if(is_array($to)) {
foreach($to as $sendto) {
$mailresult = mail($sendto,$subject,$body,'From: Company name <'.$from.'>\r\n');
} //foreach
} else {
$mailresult = mail($to,$subject,$body,'From: Company name <'.$from.'>\r\n');
} //if
return $mailresult;
} // sendEmail


but now I get an undefined variable for properties:
Code: [Select]
#1 ERROR: Error: Undefined variable: properties in '../opengoo/application/models/notifier/Notifier.class.php' on line 141 (error code: 8)
this matches the following line in Notifier.class.php:
Code: [Select]
self::objectNotification($comment, $subscribers, logged_user(), 'new', "new comment posted", array($object->getObjectName()), $properties);
EDIT: the error above remains, but my changes to the sendemail script work, and subscribers other than the person entering in the comment or completing the task are notified.  I hope this is useful to other users who have web hosts with limited php emailing abilities.
« Last Edit: August 27, 2009, 03:06:44 pm by nonsequitur »

cguyer

  • Newbie
  • *
  • Posts: 33
    • MSN Messenger - colby_guyer@hotmail.com
    • AOL Instant Messenger - excag03
    • Yahoo Instant Messenger - excag18
    • View Profile
    • TIU11
    • Email
Re: Subscription notifications for tasks and milestones
« Reply #3 on: September 16, 2009, 02:49:18 pm »
works, stupid godaddy any ways.

zaro

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Subscription notifications for tasks and milestones
« Reply #4 on: March 28, 2010, 09:01:02 am »
Very helpful post.

I experience the same email problem with GoDaddy.

After researching other posts it turns that other people have resolved it by modifying the Notifier Class.

If I use this solution however, I get Internal Server Error. I tried to remove the .htaccess files but the error persisted.

I am using Feng Office 1.6.2. I am really eager to see this fixed in the next release, but meanwhile is there a workaround?

Thanks!
Zaro