Auto-email when individuals are given new membership levels

The way we need to have our membership registration process work, is people will register and then get notified that their membership is pending.

After reviewing their credentials, we'll give them one of three different membership levels. In most cases, people will get the first level of membership and then be given the higher tiers over time.

There is no cost for the memberships, and they will be assigned their membership manually. When I add a membership level to someone's account, I'd like to have an email go out, specific to that membership level. Can Memberships 2 Pro handle this, or do I have to somehow integrate with a different process? Thanks so much.

  • Vinod Dalvi

    Hi Thomas,

    I hope you are well today and thank you for your question.

    The way we need to have our membership registration process work, is people will register and then get notified that their membership is pending.

    Yes to achieve this you can use the following Automessage plugin and configure its email with custom content to be sent on registering the user.

    https://premium.wpmudev.org/project/automatic-follow-up-emails-for-new-users/#product-usage

    There is no cost for the memberships, and they will be assigned their membership manually. When I add a membership level to someone's account, I'd like to have an email go out, specific to that membership level.

    Yes by default the plugin sends an email to the user to whom the membership is assigned as shown in the attached screenshot.

    You can edit this email from the Membership 2 Settings on the following path as shown in the second attached screenshot.

    Admin Area -> Membership 2 -> Settings -> Automated Email Responses

    Best Regards,
    Vinod Dalvi

  • Thomas

    Hmm. I'm confused. Buddypress becomes the default registration process. I'm guessing I need to disable that so it goes through Membership 2, correct?

    Then Membership 2 has auto-emails, so why do I need the other plug-in?

    As for the Membership 2 auto-emails, I don't see how I can configure them to be triggered when I add a membership type to a users account. It looks like they're all standardized and cannot be associated to a membership type or process.

  • Vinod Dalvi

    Hi Thomas,

    Hmm. I'm confused. Buddypress becomes the default registration process. I'm guessing I need to disable that so it goes through Membership 2, correct?

    You don't need to disable that instead just set the Buddypress Register page to None in the Buddypress settings on the following path as shown in the attached screenshot.

    Admin Area -> Settings -> BuddyPress -> Pages

    Then Membership 2 has auto-emails, so why do I need the other plug-in?

    Because it sends an email on specific event like sending an email when a member completes the signup for a paid membership etc.

    As for the Membership 2 auto-emails, I don't see how I can configure them to be triggered when I add a membership type to a users account. It looks like they're all standardized and cannot be associated to a membership type or process.

    Yes you are right. Currently they are not associated with membership type but you can use any of the following placeholder in the email content so that they will get replaced dynamically.

    %username%
    %ms-name%
    %blog-name%
    %ms-account-page-url%
    %ms-invoice%

    Regards,
    Vinod Dalvi

  • Ash

    Hello @Thomas

    I hope you are well today.

    I am sorry for the long delay in your thread. I have read the whole thread and it made me confused too, sorry!

    Then Membership 2 has auto-emails, so why do I need the other plug-in?

    As for the Membership 2 auto-emails, I don't see how I can configure them to be triggered when I add a membership type to a users account. It looks like they're all standardized and cannot be associated to a membership type or process.

    You don't need any other plugin.

    To be more clear, do you just want to send an email to the user when you manually add them into a membership?

    Cheers
    Ash

  • Ash

    Hello @Thomas

    I hope you are well today.

    Also, is there an automated email response for registration completion but NOT activated...so they have completed the registration form, but we must confirm details before approving their membership level. It is basically a "Thanks for registering, we will get back to you in 24 hours" message.

    This is not possible out of the box, I am afraid. It will need to a fair amount of code to customize the plugin.

    For email solution, please try the following code:

    add_action( 'ms_controller_member_assign_memberships_done', 'ms_controller_member_assign_memberships_done_cb', 99, 3 );
    function ms_controller_member_assign_memberships_done_cb( $member, $memberships, $obj ) {
    
        $mems = '';
        foreach ( $memberships as $membership_id ) {
            $followup = MS_Factory::load(
    				'MS_Model_Membership',
    				$membership_id
    			);
            $mems .= $followup->name;
        }
    
        $user = $member->get_user();
        $to = $user->user_email;
        $subject = 'Your membership is changed to ' . $mems;
        $body = 'Your membership is changed to ' . $mems;
    
        wp_mail( $to, $subject, $body );
    }

    Please edit subject and message to fit your needs.

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

  • Thomas

    I'm probably asking the same thing again, so forgive me if I'm struggling with this. Based on other membership programs I've used before, I can't imagine what I'm outline below is unusual. This is what we must have happen with our membership site. If we need an additional plug-in to support it, or if we need to have a trigger for Mailchimp to send an email, that's fine. I just need to get this done ASAP.

    Step 1: Prospective member registers on our site (http://hlweo.com/), using the "Register with HLWEO" purple button. This takes them to the membership page, which we've re-designed to look more like a brief terms page. By clicking on the button, it takes them to the registration page. Once completed, they are given an account, with a membership that doesn't give them access to anything extra. At this point, they are "registered, but they must be approved."
    -->> email need: We want to send them a message that says "Thank you for registering. Your registration will be reviewed and if approved, you'll be notified within 24 hours." (It's a bit longer, but that's the gist of it)

    Step 2: We review the new registrations, and if they are approved, we remove the "Pending" membership and add "HLWEO Member" (which is tier 1) or "HLWEO Leader" (which is tier 2).
    email need -->>:
    HLWEO Member: We send an email outlining that they are approved for this level of access and we detail what is included with this member level access. We then direct them to our "HLWEO Member Get Started" page on the site.
    HLWEO Leader: We send a different email outlining what's included in this level and how it has the "Member" level access, plus some other stuff. We then direct them to our "HLWEO Leader Get Started" page on the site.

    With those three different emails in mind, how do we get this done?

  • Ash

    Hello @Thomas

    I hope you are well today.

    Please try the following code:

    add_action( 'ms_controller_member_assign_memberships_done', 'ms_controller_member_assign_memberships_done_cb', 99, 3 );
    function ms_controller_member_assign_memberships_done_cb( $member, $memberships, $obj ) {
    
        $followup = MS_Factory::load(
    			    'MS_Model_Membership',
    			    $memberships[0]
    		    );
        $mems = $followup->name;
    
        $user = $member->get_user();
        $to = $user->user_email;
        switch( $memberships[0] ) {
    	case 9:
    	    $subject = 'Your membership is changed to pending';
    	    $body = 'Your membership is changed to  pending';
    	    break;
    
    	case 28:
    	    $subject = 'Your membership is changed to HLWEO Member';
    	    $body = 'Your membership is changed to HLWEO Member';
    	    break;
    
    	case 20:
    	    $subject = 'Your membership is changed to HLWEO Leader';
    	    $body = 'Your membership is changed to HLWEO Leader';
    	    break;
        }
        wp_mail( $to, $subject, $body );
    }

    Change the 9, 28 and 20 with correct membership ID no. And change the email content and subject for each membership.

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    I have just tested and worked fine for me.

    Cheers
    Ash

  • Thomas

    Thanks you @Ashok. Once I've added this, do I need to remove one membership type to add the next one, or can I just add more membership types to the same person? It seems that if I just add the membership type, people aren't able to access some content that they should.
    If I delete their lower level membership, they get a notification saying their membership has been cancelled, which creates a lot of confusion.

  • Ash

    Hello @Thomas

    I hope you are well today.

    Once I've added this, do I need to remove one membership type to add the next one, or can I just add more membership types to the same person? It seems that if I just add the membership type, people aren't able to access some content that they should.

    This issue is not related to the above code. Does the above code send email when you add a membership to the user?

    About protection issue, I have just tested and it worked fine for me to have a multiple memberships. If it doesn't work for you would you please create a new thread for this issue as this is different than topic title? It will help us to provide better support and organize the threads.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.