Author Topic: Email Reminders on OpenGoo don't work.  (Read 2719 times)

ras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Email Reminders on OpenGoo don't work.
« on: October 16, 2009, 09:44:29 am »
Hello,

Email reminders aren't working and this is a critical issue for me.

I have the cron.php on the crontab, and this is the output:

When no reminders are to be sent:
2009-10-16 12:12:01 - Sending notifications...
2009-10-16 12:12:01 -  notifications sent.
2009-10-16 12:13:01 - Sending notifications...
2009-10-16 12:13:01 -  notifications sent.

When reminders are to be sent:
2009-10-16 12:11:02 - Sending reminders...
PHP Fatal error:  Call to a member function getColumnValue() on a non-object in /servers/opengoo/application/hooks/opengoo_hooks.php on line 120

I went for some debugging and this is what I came up with:
these are lines 118-120 on the offending file:

   118  function opengoo_reminder_email($reminder, &$ret) {
   119          $object = $reminder->getObject();
   120          $date = $object->getColumnValue($reminder->getContext());

A var_dump of the $object after line 119 gives out "NULL"
A var_dump of the $reminder gives out a huge structure with over 400000 lines



a2opinion

  • Full Member
  • ***
  • Posts: 177
  • Christian
    • View Profile
    • A Second Opinion
Re: Email Reminders on OpenGoo don't work.
« Reply #1 on: October 16, 2009, 10:28:19 am »
wow, that's a new one on me.  This problem only shows up when triggered by the cron job?  Do notifications go out ok, when pushed by a user?

ras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Email Reminders on OpenGoo don't work.
« Reply #2 on: October 16, 2009, 10:36:46 am »
Hi,

Opengoo sends emails properly when assigning tasks, etc. I just doesn't send reminders.

The problem is with the kind of reminders that are supposed to be sent *5 minutes before appointment*, etc.

Those that are sent using cron.php.

Best regards,
ras
« Last Edit: October 17, 2009, 07:22:05 am by ras »

ras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Email Reminders on OpenGoo don't work.
« Reply #3 on: October 17, 2009, 02:48:25 pm »
Hello,

Any ideas on how to fix this?

Any other debug I can help with?

Best regards,
ras

ras

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Email Reminders on OpenGoo don't work.
« Reply #4 on: October 19, 2009, 11:19:52 am »
*fixed* I had a problem with a reminder, possibly malformed, and was blocking all other reminders.

Some other problems came up - I still wasn't able to send reminders.

Changes were made to the following files in order to fix this:

opengoo/application/models/object_subscriptions/ObjectSubscriptions.class.php
Replaced the line
    //$user_object_workspaces = $object->getWorkspaces(logged_user()->getWorkspacesQuery());
with
    $user_object_workspaces = $object->getWorkspaces($user->getWorkspacesQuery());

opengoo/cron.php (probably not the best place to place this):
Added the line
include APPLICATION_PATH . "/helpers/permissions.php";

Attached is the diff file