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) »
  • Multiple renewal notices?
Pages: [1] 2

Author Topic: Multiple renewal notices?  (Read 16322 times)

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Multiple renewal notices?
January 13, 2009, 02:12:39 pm
Is there a way to set multiple renewal notices (e.g. one warning at 30 days, one warning at 10 days, one at expiration)? We have found a spot where we can set one notice, it seems (in membership type) -- but we're hoping it's possible to schedule multiples as I described.

Thanks for any insights.
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Multiple renewal notices?
January 13, 2009, 02:29:24 pm
You can potentially do this by modifying the script which generates the reminder messages:

bin/UpdateMembershipRecord.php

NOTE: This script - which is run from the command line (usually via a cron job) - is distributed as UpdateMembershipRecord.php.txt because it always requires some modifications before it can be run (these are described in that file).

Currently the following line in the script (looking at the 2.2 version) sets the reminder_date column in a membership record to NULL once the reminder is sent out.
Code: [Select]
CRM_Core_DAO::setFieldValue( 'CRM_Member_DAO_Membership', $dao->membership_id, 'reminder_date', 'null');

You could potentially configure your initial Reminder to 30 days prior to expiration and then add logic to this part of the script to evaluate the current reminder_date value and recalculate it OR set it to NULL depending on the number of days between it and the expiration date.
Protect your investment in CiviCRM by  becoming a Member!

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: Multiple renewal notices?
January 14, 2009, 06:22:36 am
Thanks, Dave, I will definitely give this a try... probably after we upgrade. (We still have to upgrade to 2.1, but now I wonder if we should just wait until 2.2 is ready...)
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

wsta

  • I’m new here
  • *
  • Posts: 3
  • Karma: 2
Re: Multiple renewal notices?
January 30, 2010, 03:37:07 pm
I added multiple reminder notices with the following changes to UpdateMembershipRecord.php (this script needs to be triggered run or run from a CRON job). Note this leverages the existing design of CiviCRM. When a membership is created, it computes a reminder date. When this script is run, if the reminder in >= todays date, it sends triggers a reminder notice, and in the current design resets it to null (sending only one notice)  Our members do not always respond to a single notice, so the below was added to add a hardcoded interval (in this case a week) and it would add to interval and once it reaches 30 days past it stops sending reminders. ( the scripts are triggered once a week). You can program different values, and it would be better if these parameters were stored in a screen and not hardcoded, will eventually do that.

About line 211 in UpdateMembershipRecord.php there is code to set the renewal date to null after sending a notice. This is version CRM 3.0. Shortly after the mod region -- an activity record is generated for the renewal - and since there are multiple notices now I append the next reminder date or final reminder comment to the activity description.

If this patch catches one the CiviCRM developers, I need some help -- think the next thing that would truly make this useful would be to include select membership fields (ideally, the date the membership is expiring in the notice). I am using Joomla and have been able to use the checksum token to allow them to click a link update their profile, but the only place a membership renewal is displayed is after they login and go to a contribution form, I was not able to get a contribution link for renewal to work in joomla - so they just have to login and go to the contribution form to see their current level and expiration date. The notices can vary by membership, so type of membership can be handled by different templates, but not the renewal date! I far as I can tell -- can't include and membership fields in profiles for the most part (probably because of a one to many in database relationship, but why not pick the most recent membership?). The direction for CiviCRM seems to be multiple memberships as future focus, but our organization's needs are simply to get just on membership renewal processing to work more smoothly. My workaround for the renewal date is to use a script to copy the membership information to a custom field and then use that in custom field profiles and renewal template emails (not ideal but ok) 
 
 //set membership reminder date to NULL since we've sent the reminder.
                       
                        // *******begin modification*****************************************
                        //CRM_Core_DAO::setFieldValue( 'CRM_Member_DAO_Membership', $dao->membership_id, 'reminder_date', 'null');
                       
                     
            // Modification - schedule repeat renewal notices until interval past end of membership
            // 86400 is number of seconds in a day
            // currently from first notice this will schedule another notice every 7 days until 30 days past end

            // add 7 days to the next renewal notice
            $reminder_date = $reminder_date + (86400 * 7);
            // end of renewal notices 30 days past end of membership date
            $end_notices_date = CRM_Utils_DATE::unixTime( $dao->end_date )+ (86400 * 30);
         
            if ($reminder_date < $end_notices_date) {
               //create string for SQL new reminder
               $sql_new_reminder_date = Date('Ymd',$reminder_date);
               $reminder_repeat_msg="Next Reminder " . $sql_new_reminder_date;
                            CRM_Core_DAO::setFieldValue( 'CRM_Member_DAO_Membership', $dao->membership_id, 'reminder_date', $sql_new_reminder_date);
                        } else {
                           //set membership reminder date to NULL since we've sent the last reminder
               $reminder_repeat_msg="Final Reminder";
                           CRM_Core_DAO::setFieldValue( 'CRM_Member_DAO_Membership', $dao->membership_id, 'reminder_date', 'null');
                        }
          // end modification *************************

 // insert the activity log record.
                        $activityParams = array( );
                        $activityParams['subject']            = $allTypes[$dao->membership_type_id] .
                            ": Status - " . $allStatus[$newStatus['id']] .
                            ", End Date - " . CRM_Utils_Date::customFormat(CRM_Utils_Date::isoToMysql($dao->end_date), $config->dateformatFull) .
                            " - " . $reminder_repeat_msg; //******** mod - appended reminder msg ********



Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Multiple renewal notices?
February 01, 2010, 02:12:50 pm
This looks like a good addition to the script - and I think we can move it into the core distribution with a few changes:
- Provide a spot for folks to set 'Reminder Frequency' and 'Remind Until' variables, set these to empty value by default
- If these are empty, then the script behaves as currently (no additional reminders, remind_date set NULL), otherwise uses your new behavior

Given that folks have to go in and edit the script before using it in any case, we think it's fine to have the 'additional reminder frequency' and the 'remind until' day values 'hard-coded' in the script.

We agree that it would definitely be good to expose the membership end date (as well as other membership parameters) to the reminder template as you've noted. I've done the coding for this, filed in the issue tracker as:

http://issues.civicrm.org/jira/browse/CRM-5746

Would be great if you could grab this new versions of the two affected files from svn (or grab the diffs from the Fisheye tab on the issue) and test it out.

http://svn.civicrm.org/civicrm/branches/v3.1/bin/UpdateMembershipRecord.php.txt
http://svn.civicrm.org/civicrm/branches/v3.1/CRM/Core/BAO/MessageTemplates.php

Example: In the message template (body and or subject) you can do this now:

Code: [Select]
Your {$memberParams.membership_type} membership will expire on {$memberParams.end_date|crmDate}. Please renew now!
Then you can submit your patches against this latest version - so we can have both improvements in the 3.1.2 release version.

Thanks for stepping up and adding this improvement!
Protect your investment in CiviCRM by  becoming a Member!

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: Multiple renewal notices?
May 12, 2010, 03:05:51 am
This feature would be super helpful to several of my clients. Are there any plans to include it in the core distribution of 3.2 or a future release?

Thanks,
James

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Multiple renewal notices?
May 12, 2010, 06:56:36 am

No current plans to include this in 3.2

however, would make a great addition to the code base. We'd want to make it more configurable (number of reminders and delay between reminders)

We'd also want a patch against the latest code base (3.2 currently)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

annaleevk

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 3
  • Carpe Noctem!
    • Women in Development, New York
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.48
  • PHP version: 5.2.14
Re: Multiple renewal notices?
December 15, 2010, 10:00:24 am
Lobo,

Has this feature made it into the 3.3 release?  I have a client who also wants up to 5 renewal reminders generated off of the end date.  I'd like to know if it's possible before I suggest this to the membership committee and board.

1 email: 60 days prior to end date
1 email: 30 days prior to end date
1 email: on end date
1 email: 30 days after end date
1 email: 60 days after end date

Thanks,
Annalee


Annalee Van Kleeck
Lyric Systems, LLC
201 951.8711
annalee@lyricsystems.com

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Multiple renewal notices?
December 15, 2010, 10:10:34 am

No. We never recd a patch for this from the folks on this thread

This would definitely be a great addition and has come up before. Would be cool if you can convince the committee/board to sponsor this feature.

Something like this could potentially also happen via our rules integration. there is an active make it happen for generic rules integration for 3.4

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

annaleevk

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 3
  • Carpe Noctem!
    • Women in Development, New York
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.48
  • PHP version: 5.2.14
Re: Multiple renewal notices?
December 15, 2010, 11:35:36 am
Lobo,

No promises but if I send you a spec can you give me a quote of how much this would cost?  There are a few other items that go along with this and a more user-friendly solution should definitely be a part of the CiviCRM package.

- Annalee
Annalee Van Kleeck
Lyric Systems, LLC
201 951.8711
annalee@lyricsystems.com

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Multiple renewal notices?
December 15, 2010, 11:56:50 am

Sure. better yet, cut-n-paste the spec here (or add it as an attachment)

We'll give you a rough ballpark number of hours

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

samuelsov

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 2
    • Coop SymbioTIC
  • CiviCRM version: 3.x, 4.x
  • CMS version: Drupal 6 & 7
Re: Multiple renewal notices?
January 18, 2011, 09:03:27 am
Also, i have several clients who needs to send a different template if the date is before the end of the membership (notice that the membership is about to finish) or after the end of the membership (renewal reminder). For now, i'm just modifying the file UpdateMembershipRecord but it could be neat to have the choice directly on the membership configuration page.
Consultant @ SymbioTIC.coop

sjthespian

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 3
    • The League of Professional System Administrators
  • CiviCRM version: 4.2.7
  • CMS version: Drupal 6.28
  • MySQL version: 5.1.66
  • PHP version: 5.3.3
Re: Multiple renewal notices?
February 22, 2011, 12:40:29 pm
I just put this patch in place on our server, I'm going to be looking at what it would take to extend it to use a different template for post-expiration and to allow tuning of the reminder period. I also want to make the "from" address configurable as I just sent a batch of notices out this morning that all came from "EMAIL@fixme.org" as I didn't catch that hard-coded into the script.
Dan Rich <drich@lopsa.org>
    Director, LOPSA - http://lopsa.org/

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: Multiple renewal notices?
March 13, 2011, 10:18:06 pm
Just wanted to check in on the status of this as I just had someone ask for the ability to be able to send out multiple notices - 60 days out, 2 weeks out, day of, and one letting them know their membership is now expired.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Multiple renewal notices?
March 14, 2011, 09:29:19 am

No progress on this as yet. If folks really need it, would be good for a group to collaborate and code / sponsor it. I suspect its a 20-40 hour project depending on the amount of configuration and flexibility we want to embed in the process

If we get a couple of lead sponsors for this, we could shoot for this as a 4.1 Make it Happen

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Multiple renewal notices?

This forum was archived on 2017-11-26.