Expiration notices sent to members with overlapping membership types

Discussion in 'Troubleshooting' started by achahistory, Jan 20, 2015.

  1. am495p

    am495p New Member

    Joined:
    Nov 30, 2013
    Messages:
    6
    The problem: My site offers dozens of different membership options. When a member renews and chooses a new membership type, he has two overlapping memberships and still receives expiration notice e-mails for the original membership type. The issue that I need fixed is the sending of expiration notice e-mails for the original membership type. These e-mails have caused a lot of confusion among our members.

    Fix needed: Send expiration notice e-mails to members based on their MAXIMUM EXPIRATION DATE––i.e., the expiration date of the new membership type, not the expiration date of the original membership type. Using the example of overlapping memberships below, the member should not receive an expiration notice until around 2016-06-30.

    MEMBERSHIP TYPE A EXPIRE: 2014-01-30
    MEMBERSHIP TYPE B EXPIRE: 2016-06-30

    Is this something that aMember can support out of the box––or would a hack/customization be needed? These exceptions are listed in the e-mail messages admin panel.

    Expiration message will not be sent if:
    • User has other active products with the same renewal group
    • User has unsubscribed from e-mail messages


    Is it possible to add this condition?
    • User has other active products



    Further requested customization-–please respond with ideas for implementation: When members have two overlapping membership types, notify the admin by sending an e-mail message with the member’s subscription information (member name, old membership type, new membership type, expiration dates of each membership, link to Edit User section of admin panel).
  2. am495p

    am495p New Member

    Joined:
    Nov 30, 2013
    Messages:
    6
    After doing some investigation, I'd like to ask: Is this something that could be handled by assigning all products (membership types) to the same renewal group?
  3. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    There are quite a few options you can consider, depending on your particular situation:

    1) Use the "Send E-Mail only if customer has no subscription" option in your expire emails.

    2) Use the 'Product Upgrade Paths' option to offer upgrades instead of separate membership types, especially if they are supposed to be non-overlapping (e.g. Bronze, Silver etc)

    3) Use my "Expire on Upgrade" plugin to kill the old subscription and set an expiry date which is far enough in the past that expiry notices won't go out.

    The renewal group option doesn't work for recurring subscriptions though there is a hack I've used successfully in a couple of my largest membership sites which allows it to work - but this is only good in cases where it matters more to have non-overlapping memberships than it does to have payment date and access dates that sync up.

    Anyhow, hope this gives you some ideas on options to expore.

    Cheers
    Rob
    Last edited: Jan 21, 2015
  4. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Rob
    Can you explain how you achieved that as I have been thinking about it as it would save me having to realign expiry dates manually.
  5. am495p

    am495p New Member

    Joined:
    Nov 30, 2013
    Messages:
    6
    Thanks a lot, Rob! This is very helpful and goes a long way to solving our problem.
    I took a look at this and the way this option is worded is a bit confusing. I don't want e-mails to be sent if a member has a valid subscription to any other product––that is, a second product with a later expiration date.

    1. Will selecting the Send E-Mail only if customer has no subscription > Any Product option stop e-mails from being sent to anyone with any valid subscription to any other product? Is it that simple?

    2. I have expiration reminders go out 90, 30, and 7 days before expiration. Will the Send E-Mail only if customer has no subscription > Any Product option still allow these e-mails to go out if the member has a subscription to only a single product?

    Here are two scenarios:

    Scenario 1: aMember SHOULD send reminder e-mails
    MEMBERSHIP TYPE A (member's only product): Expires 2015-01-30

    Scenario 2: aMember SHOULD NOT send reminder e-mails
    MEMBERSHIP TYPE A: Expires 2015-01-30
    MEMBERSHIP TYPE B: Expires 2016-06-30
    Last edited: Jan 21, 2015
  6. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    Sure, you need to edit the file: amember/application/default/models/Invoice.php

    Look for this section, around line 1124:

    PHP:
    if ($isFirstPeriod) {
                foreach (
    $this->getItems() as $item) {
                    if (
    $item->rebill_times) {
                        
    $start $transactionDate// no games with recurring billing dates
                    
    } else { // for not-recurring we can be flexible
                        
    $ppr $item->tryLoadProduct();
                        if (
    $ppr)
                            
    $start $ppr->calculateStartDate($transactionDate$this);
                        else
                            
    $start $transactionDate;
                    }
                    
    // run hook
    And simply comment out the 'no games' part of the if/else like so:

    PHP:
    if ($isFirstPeriod) {
                foreach (
    $this->getItems() as $item) {
                    
    //if ($item->rebill_times) {
                    //    $start = $transactionDate; // no games with recurring billing dates
                    //} else { // for not-recurring we can be flexible
                        
    $ppr $item->tryLoadProduct();
                        if (
    $ppr)
                            
    $start $ppr->calculateStartDate($transactionDate$this);
                        else
                            
    $start $transactionDate;
                    
    //}
                    // run hook
    You'll need to do this any time you update aMember, as the invoice model gets updated a lot.

    I asked the aMember team to add an option to allow us to choose whether to 'allow games with recurring billing dates', but they feel strongly that its more confusing to members to have payments and access dates that don't match up than suffering the inconvenience of subscriptions which overlap.

    To be fair, you can get into some 'games' using this approach, but generally it has worked pretty well for us in a site with over 2000 members and multiple membership types and has been preferable to complaints of 'lost time' when they renew a few days or even weeks early.

    This is especially so with PayPal payments, when members tend to simply start a new subscription when their old payment method expires, rather than updating the payment method on the old subscription.

    Cheers
    Rob
    Last edited: Jan 21, 2015
  7. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287

    AFAIAA, setting Send E-Mail only if customer has no subscription > Any Product will disable the expiry notice completely if they have ANY subscription active - even another one to the same product.

    So, yes, this would work for emails that need to be sent AFTER EXPIRY OF THE LAST ACTIVE SUBSCRIPTION. But would not work for your 90, 30, and 7 days before expiration notices (as present sub is still active) or expiry where there is still an active subscription to some other product.

    You can set multiple expiry notices, however, so you can create the logic you need... e.g. using your scenarios, you could simply create an expiry email that sends if A is active and there is no active subscription to B

    Cheers
    Rob
  8. am495p

    am495p New Member

    Joined:
    Nov 30, 2013
    Messages:
    6
    The renewal group option seems to be the best option here, but I'm concerned about issues with recurring subscriptions. Can you explain how the renewal group feature fails to work with recurring subscriptions? Do the notices simply go out anyway?

    Can you also explain what your hack achieves?

    I have about 80 different membership options (with different terms, prices, etc.) so the logic would be entirely too difficult to set up. Any other ideas for a workaround?

    Rob, thanks so much for your help. You're a great resource for working with all of the peculiarities of aMember.
  9. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Thanks Rob for the recurring payments hack.
  10. robw

    robw CGI-Central Partner

    Joined:
    Dec 18, 2007
    Messages:
    287
    The aMember team have disabled renewal groups for recurring subscriptions, to ensure that payment dates and access periods always match up.

    It means that multiple recurring subscriptions always overlap, rather than obeying the renewal group rules.

    The hack removes this restriction.

    The pros of using the hack are that members always get what they pay for - there are no overlapping subscriptions, such as when a member sets up a new sub a few days (or weeks) before the old one expires and no complaints about lost time.

    The cons are that:
    • Newly purchased subscriptions may not be immediately available - e.g. if the "silver" package expires in two months and they buy "gold" then the new sub won't start until the silver expires, and payment will always be two months in advance of access. But this case would be better handled by the upgrade paths option anyhow.
    • You have to be careful with the order of refunds, otherwise you can expire current access, leaving a 'future' access. But as you can edit access dates, this is not such a big deal.
    In short, when your site has a couplex mix of options and upgrades, there is always going to be an amount of manual work. In my experience, it's easier to handle the odd double payment or future dated membership than it is to constantly deal with complaints about lost time.

    So you pays yer money and takes yer choice.

    I'd suggest talking to the aMember team to look at your specific situation and advise the best option.

    Cheers
    Rob
  11. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Thanks for your above comments Rob.

    In my case I have only one product, downloadable PDF boiler manuals, with two basic payment methods, renew annually or recurring payments, so using your hack has all the advantages and a just small disadvantage of non synchronised payment and access periods.

    This small disadvantage is easily taken care of by explaining the reason - to save members any loss of access time that they have paid for.

    aMember has been made highly customisable and for the option to be included by default would not, I think, cause any user (owners of software as distinct from members using it) very little extra confusion. Like many of the options already included you make the choices what suits you best when you configure it.
  12. am495p

    am495p New Member

    Joined:
    Nov 30, 2013
    Messages:
    6
    Great! Thanks, Rob!

Share This Page