we recently encountered an issue after migrating to CiviCRM.

In the original system, membership renewals were considered discrete, separate memberships rather than a contiguous one.

When we imported the membership history from the original CRM to CiviCRM, the membership history imported fine, and the old memberships were marked as "Expired". However, due to a scheduled reminder rule ("Send membership renewal notice 7 days after expiry"), we're finding that people who have already renewed a membership and have an active one will still get a reminder notice because one of their expired memberships meets that criteria.

Does anyone have a code snippet to adjust the schedule reminder for memberships to only send a reminder if there are zero ACTIVE memberships on record?

2 Answers 2


yes this can be problematic. You may also find that having other 'expired' memberships will trip you up when doing other searches etc. Therefore in a similar situation we have opted to find all the historic expired memberships and set them to a new Membership Status of 'previous expired'. that helped reduce confusion and would resolve your Scheduled Reminder issue to.


I have a client who deals with a related situation. In their case, we use SQL to update membership statuses.

In their situation, they have people who create new memberships that supersede an old membership - but they still get membership reminders on the old membership. This SQL runs hourly on a cron job and sets the old memberships to "expired" with the "status override" flag set:

mysql <dbname> -e "UPDATE civicrm_membership cm2  SET status_id=35, is_override=1  WHERE cm2.status_id = 34 AND  cm2.contact_id IN  (SELECT contact_id FROM (SELECT contact_id, status_id FROM civicrm_membership) cm JOIN civicrm_membership_status cms ON status_id = cms.id WHERE cms.is_current_member = 1 GROUP BY contact_id HAVING count(contact_id) > 1)"

Owing to different membership status configuration, this won't work as-is for you, but should give you the right idea! They're in a slightly different situation in that they have "grace" membership statuses that are still active

  • Hey, this is pretty awesome -- you're right that it doesn't work for us as-is, but this is definitely a great reference for us! Commented Oct 26, 2015 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.