CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Scheduled reminders for membership in CiviCRM 4.3.3 not working
Pages: [1]

Author Topic: Scheduled reminders for membership in CiviCRM 4.3.3 not working  (Read 4822 times)

Jens-Erik

  • I post occasionally
  • **
  • Posts: 60
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.4
Scheduled reminders for membership in CiviCRM 4.3.3 not working
May 16, 2013, 08:22:02 am
Hi, I’ve set up a reminder for expired memberships for 1 month before expiry and another reminder for 0 days because I’ve just imported the members’ contact data and membership fee payments, and I want to notify also the members whose paid term ends in less than one month form now on. On June 15th several membership terms expire, but so far (16th afternoon, cron job for scheduled reminders has run at 15:30 h today) no mails were sent out, the same for a test site with the same data. On the other hand for some real and test members, reminder mails were created (and stored in the database), but not (yet) for those membership expiring on June 15th.

And yes, sending mails and cron jobs do work. On the real live site Send Scheduled Reminders runs daily, on the test site hourly, and cron jobs are triggered every 15 min on both sites. Btw.: Almost every day the daily Send Scheduled Reminders runs 15 min later than on the previous day, so probably it won’t run at all on one day eventually. But this is another problem, if at all.

When exactly should the mails for June 15th minus 1 month be sent? The first time that Send Scheduled Reminders is run on May 15th? Or on the 16th? Does time within the day matter at all? How is the reminder triggered? Which script should do the job and which fields in which tables are affected? If I knew that, I could check things out.

Does it matter if memberships imported or created before or after the reminders have been set up?

According to the current CiviCRM data architecture http://wiki.civicrm.org/confluence/display/CRMDOC43/CiviCRM+data+architecture there is a field reminder_date in civicrm_membership, but in fact it isn’t. I guess that belonged to the old reminder mechanism. But how is the current one supposed to work? ???

Is it a problem to have more than one reminder set up for one membership type? Would repetition on expiry date do the same job (i. e. notifying about the memberships that expire in less than on month)?

And one last question about repetition: Are the repetitions sent in any case, or just if the membership hasn’t been updated yet? I don’t want to send out invoices to members who have already paid, as this would get on the nerves of the members and cause misunderstandings.
« Last Edit: May 20, 2013, 04:16:52 pm by Jens-Erik »

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Scheduled reminders for membership in CiviCRM 4.3.3
May 17, 2013, 03:04:08 am
Quote
When exactly should the mails for June 15th minus 1 month be sent?

The mails should be sent on May 15th. I just did a quick check for membership expiring on 17th June and another one on expiring on 17th May, ran job (on 17th May) and it worked - sent mail to both.

Quote
Does it matter if memberships imported or created before or after the reminders have been set up?
No. The query to build recipients is fired when the job is run. You can check buildRecipientContacts method in CRM/Core/BAO/ActionSchedule.php

Quote
According to the current CiviCRM data architecture http://wiki.civicrm.org/confluence/display/CRMDOC43/CiviCRM+data+architecture [nofollow] there is a field reminder_date in civicrm_membership, but in fact it isn’t. I guess that belonged to the old reminder mechanism. But how is the current one supposed to work?
Yes, reminder_date in civicrm_membership has been dropped. We 'll update the docs.
The current reminders are logged in the civicrm_action_log table.

Quote
Is it a problem to have more than one reminder set up for one membership type?
Nope. You can send multiple reminders for each of the membership types.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Jens-Erik

  • I post occasionally
  • **
  • Posts: 60
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Scheduled reminders for membership in CiviCRM 4.3.3
May 20, 2013, 12:41:19 pm
Quote from: Yashodha Chaku on May 17, 2013, 03:04:08 am

The mails should be sent on May 15th. I just did a quick check for membership expiring on 17th June and another one on expiring on 17th May, ran job (on 17th May) and it worked - sent mail to both.

Hmmm, very strange. ??? Are you sure you tested on 4.3.3? On my test site I got 2 reminders, but possibly on 4.3.2 (it was on a date 4.3.3. was already published, but probably not yet installed by me, so I’m not sure). But now I don’t get an reminders at all, neither on my Mac with Apache 2.2.24.and PHP 5.4.12 nor on the Linux (CentOS) server with Apache 2.2 and PHP 5.3.3. I imported the same real membership data, but also when I add test memberships on my test server (Mac), I don’t get any reminders.

Thanks for enlighten me about how the process should work. civicrm_action_schedule looks okay, but civicrm_action_log doesn’t get any new entries (there are only the 2 from the time when it was still working). I haven’t fully retraced everything in ActionSchedule.php yet, as there are hardly any comments in it. Do have any tips for intermediate steps to trace for debugging?

Btw: membership statuses are being updated correctly. But afik that doesn’t have to do anything with the scheduled reminders.

Should I file an issue?
« Last Edit: May 20, 2013, 12:46:31 pm by Jens-Erik »

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
May 22, 2013, 04:57:07 am
Quote
Are you sure you tested on 4.3.3?

I checked on my local sandbox that runs the latest code base for 4.3 which should be out soon.

Quote
Do have any tips for intermediate steps to trace for debugging?

You might wanna check $query (around line no 910) in buildRecipientContacts method in CRM/Core/BAO/ActionSchedule.php

Quote
But afik that doesn’t have to do anything with the scheduled reminders.
Yes, scheduled reminder runs separately.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Jens-Erik

  • I post occasionally
  • **
  • Posts: 60
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
May 22, 2013, 05:48:42 pm
Just a short update on the issue: It seems to be the permissions of sites/default/files/civicrm/templates_c/. I must correct myself a bit. If I run the jobs from the scheduled reminders webpage, it works, and when I ran it on my test site from the terminal or cron, I got an error that the script can’t write to <my drupal directory>/sites/default/files/civicrm/templates_c/:

Quote
CiviCRM does not have permission to write temp files in /Library/WebServer/Documents/community/sites/default/files/civicrm/templates_c/en_US/, Exiting

Before I also ran the job from the web page, but maybe not on the exact scheduled day, but later.

On my Mac I installed cron as my user name, i. e. not root. After chmod g+w <my drupal directory>/sites/default/files/civicrm/templates_c it works (as I’m in the www group, otherwise chmod go+w would have helped).

The strange thing is that on the live server I installed the crontab as root, but still it didn’t work, and I got the same error message somewhere in the log file. After chmod I haven't got any mails though I adopted the reminder date so that it should have fired. I’ll check it out tomorrow.

So it might just be a permission problem, but anyway: It’s strange and hard to find, as the protocol in CiviCRM says it ran successfully.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
July 06, 2013, 10:43:15 pm
@Jens - yes, cron tasks may fail if you don't have permissions to write to those files.

Ideally, scheduled tasks in terminal should run as the same user as your www user on the server. The actual user varies - could be user "_www" on your Mac if using the default Apache, or user "jens" if running MAMP perhaps, and user "www-data" on a Debian / Ubuntu box ... identify the correct user (ie, whoever owns the files generated in templates_c/*) and make the cron task run as them.

Using root user or chown to resolve these perms issues may cause other perms issues later, when your www user isn't able to write to templates_c/*, so be circumspect about that approach. Likewise, it's possible to configure groups to permit both your developer user and www user to co-exist peacefully, but you may get caught out unless UNIX permissions make sense to you - simplest thing is to run cron as the same user as the website operates as.

HTH
@xurizaemon ● www.fuzion.co.nz

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
July 07, 2013, 09:57:10 pm
I've been doing some digging and it looks like the query to select people to remind has to run on the right day because it says

if reminder_date between yesterday and today remind people

There is no forgiveness if you have a server problem & miss a day
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

bighudsonnut

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 2
    • Hudson Essex Terraplane Club site
  • CiviCRM version: 4.6.3
  • CMS version: Joomla 3.4.1
  • MySQL version: 5.5.42
  • PHP version: 5.5.23
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
August 15, 2013, 06:51:54 am
Eileen, what is used to select people to remind?  My scheduled reminders are going out to member regardless of their expiration date.  I have tried to run process_membership_reminder_date job but I think that was removed. 

bighudsonnut

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 2
    • Hudson Essex Terraplane Club site
  • CiviCRM version: 4.6.3
  • CMS version: Joomla 3.4.1
  • MySQL version: 5.5.42
  • PHP version: 5.5.23
Re: Scheduled reminders for membership in CiviCRM 4.3.3 not working
August 29, 2013, 08:49:58 am
Just wanted to report back.  I changed the Renewal Reminder to a "Membership validation" and inserted a bunch of tokens (address, phone, etc..) in.  I have made one complete pass of my entire database and it looks....looks like it is now working properly.  It was sending the renewal reminder out to everyone regardless of expiration date.  Now it appears to only be sending to folks 30 days until expiration.  It was also very helpful in getting some addresses and join dates updated. 

If you have memberships records that existed prior to the change (4.3), you might need to let the job run without sending emails and then once it looks like it has settled out, turn the emails on.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Scheduled reminders for membership in CiviCRM 4.3.3 not working

This forum was archived on 2017-11-26.