Email Expired Memberships

Discussion in 'Troubleshooting' started by vacc_webmaster, Aug 30, 2010.

  1. vacc_webmaster

    vacc_webmaster Member

    Joined:
    Jan 24, 2007
    Messages:
    51
    I think when I email users who are part of "expired users" it emails those who have been marked PAID and not expired while they hold a subscription that is expired.

    How would I email those users who have subscriptions that hold expired memberships while not holding an active subscription?

    Thank you for the feedback.
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I dont think its possible with the built in system- last time i did it, I think i used a phpmyadmin SQL query to figure out who paid, but expired and is not active.

    If you find another solution, please post.

    David
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    In amember CP -> Email users when you select Expired users, email will be sent to expired users only. (user who have only expired subscriptions )
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    But what about people who have an active subscription to a Free lifetime product, but their paid membership has expired?

    Or they have an expired membership to my 1st subscription product, but they continued with the same membership level, but this is a different product (continuation product at different pricing). I have a lot of bundled products that include memberships- subscriptions expire on, but then continue with a continuation product.

    David
  5. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Yes, we realize it is a problem, but unfortunately, there is no simple universal solution.
    In aMember v.4 we have implemented complex query UI which allows you to select customers matching several rules, for example customers from USA, with email ending on @mail.com, and having active subscription to product#1, and expired subscription to product from category "Paid Products". Then you can do actions with found customers - delete, lock, unlock, or e-mail them.
  6. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    cool. we are all looking forward to 4.0s release!

    Sorry to hijack the thread!

    Do you happen to have an sql query for this?
    I had one, but it didn't work properly.

    Basically, need to check if they have ordered products id 2-20 in the past, and are not active any of them and also allow emails to be sent to them (unsubscribe not checked)

    David
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Here is the query:
    Code:
    select * from amember_members where member_id in (select distinct(member_id) from amember_payments where product_id in (2,20) and completed = 1) and member_id not in (select member_id from amember_payments where product_id in (2,20) and begin_date <= now() and expire_date >=now() and completed =1) and unsubscribed=0
    
    It will select members who have products 2 or 20 and don't have active subscriptions to product 2 or 20
  8. shudogg

    shudogg New Member

    Joined:
    Feb 9, 2010
    Messages:
    12
    While I am unsure of the "rules" to aMember, since it is open source you could just create your own section within the admin panel. I have added a few links to the left admin panel. They link to a page I created myself, designed to do custom things.

    You could create a script to run this query for you. It could even send out the email for you, to the exact people you want. Then all you have to do is click a link on the left admin panel, select a few options, and click a button. Saves you from having to login to phpmyadmin to run queries.

    I am sure that aMember 4 will address your issue as stated above, but why wait.

    I created a script that would store my links, files, ect. into the database. I clicked on files and it pulled all the files in order form the db. Had an edit link next to each one so I could easily edit the information for it. Saved changes, add new, ect. It worked kind of like how you add the affiliate banners and links into the affiliate section.

    The possibilities are endless. This is why I love aMember so much, because all the source code is available for me to create a membership site perfect for me. I can customize it however I like.
  9. scottymac1979

    scottymac1979 New Member

    Joined:
    Jul 27, 2009
    Messages:
    12
    Can I just clarify what currently happens with Amember and a message to expired users ?

    If I had two products:

    1 Free membership (lasts a few days)

    1 Full membership (last a year)

    I have a lot of users who would take up the free membership, then allow it to expire. I would like to email to email those people with a discount for the paid membership. However, I don't really want the paid members to receive the message and come back asking for a retrospective discount.

    99% of the paid members have an expired free membership from before they signed up.

    If I send an email to 'expired users' then any active paid members with an expired free subscription would also receive the email. Have I got that right ?

    Thanks
  10. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    No. aMember will send email only for users who expired (have completed subscriptions and don't have active subscriptions) so in your situation active paid users will not receive email.
  11. scottymac1979

    scottymac1979 New Member

    Joined:
    Jul 27, 2009
    Messages:
    12
    Thanks very much ! got it now :D
  12. celina

    celina Member

    Joined:
    Sep 9, 2008
    Messages:
    86
    I am not finding that amember is sending expire letters to users who are on autorenew. In that instance amember tries 3 times to charge their card, seperated by a few days, before their subscription is cancelled. but even though I have it set to send an email at -1 days from expire (after they have expired), it is not sending out for anyone who's original subscription was on autorenew. How can we make that work?
  13. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    aMember will not send expiration notifications for recurring products.
  14. celina

    celina Member

    Joined:
    Sep 9, 2008
    Messages:
    86
    alex, is there any way to tweak the code so that it does send emails when the user expires?
  15. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Comment this line in /amember/member.inc.php mail_expire_members function:
    PHP:
    if ($paysys['recurring'] && $pr['is_recurring']) continue; // don't send if auto-recurring
  16. celina

    celina Member

    Joined:
    Sep 9, 2008
    Messages:
    86
    Thanks so much Alex! I will try that
  17. celina

    celina Member

    Joined:
    Sep 9, 2008
    Messages:
    86
    Okay, so that works, and together with the hack from another post is not just sending users the info that their account has expired (after enough rebill tries fail), but is also sending a copy to me. that's good. I also see that it looks like the emails I had set up to remind auto-renew people that their membership was about to renew and that they should check their credit card (sent at 30 and 15 days before renewal) seem to have not been sending to autorenews either, something I didn't notice before. So now they are getting those notices too.
    I have just one last question. We have a 3rd party that needs to keep track of who has expired (because we bundle a print edition of our magazine with digital edition purchases). I'm using the third-party vendor plugin to email them on orders, and on renewals. How can i get them to receive these expiration notices as well?
  18. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    So you want to send copy of all expiration notices to another email or just email when user expire?
  19. celina

    celina Member

    Joined:
    Sep 9, 2008
    Messages:
    86
    I want to be able to send a copy when the user expires to a third party. They only need to receive that one email: when the user expires. Not expiration warnings or any of the other.
  20. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Add this code to site.inc.php:
    PHP:
    setup_plugin_hook("subscription_deleted""expire_notification"); 

    function 
    expire_notification($member_id$product_id,$member){
       
    mail_customer("email@address.com""User's $member[login] subscription to product $product_id expired""User $member[login] expired");
    }

Share This Page