Does this plugin have hooks and filter?

Hello there,
Does this plugin provides hooks and filter?
Currently, I have added two different groups in my two sites.
http://legiontraining.staging.wpengine.com/: unregistered group
http://legiontraining.staging.wpengine.com/members: registered group

How it was supposed to work was:
If user subscribe from 1st site (without signing in), he will be assigned to unregistered group.
If is automatically get subscribed, after registering, he will be assigned to registered group.

But unfortunately, registration and subscription goes under same site. So user will be registered to unregistered group.

Now I need to know if there is any hooks or filter that is triggered before or after marking user as subscriber right after he is subscribed. Or do you recommend any other idea?

  • aristath
    • Recruit

    Hello again @Arin,

    You could try using something like this:

    global $email_newsletter;
    
    // The user ID here (example: userID 5 )
    $userID = 5;
    
    // Subscribe User:
    $email_newsletter->subscribe( $userID );
    // Delete user:
    $email_newsletter->delete_members( $userID );

    You can find lots of methods like the above, as well as actions and hooks by examining the e-newsletter.php file in the plugin.

    I hope that helps!

    Cheers,
    Ari.

  • Arin
    • Design Lord, Child of Thor

    Hello @aristath
    Thanks for your help
    I tried with your idea. But this couldn't help me
    I tried with and without switching to blog. But that did no work
    however
    email_newsletter->delete_members( $userID );
    worked.
    But again I dont want to delete members.
    I just want to unsubscribe them.

    what I actually want is:
    unsubscribe from Blog id 1
    and subscribe in blog id 6

    Is there any solution? Please help

    Thanks

  • aristath
    • Recruit

    Hello again @Arin,

    what I actually want is:
    unsubscribe from Blog id 1
    and subscribe in blog id 6

    Perhaps then this will help:

    global $email_newsletter;
    
    // The user ID here (example: userID 5 )
    $userID = 5;
    // The group we want the user to be added to
    $groups_id_add = 6;
    $group_id_del = 1;
    
    // Subscribe User to group $groups_id_add
    $email_newsletter->add_members_to_groups( $member_id, $groups_id_add, 1 );
    // Delete user from group $group_id_del
    $email_newsletter->delete_members_group( $members_id, $group_id_del );

    I hope that helps!

    Cheers,
    Ari.

  • Arin
    • Design Lord, Child of Thor

    Hi,
    Thanks for your assistance.
    I was asking about subscribing in members site (blog id:6) and unsubscribing in main site (blog id: 1).
    However, I have tried using above mentioned code considering both group and blog.

    $groups_id_add = 1 (Unregistered User : Group)
    $group_id_del = 2 (Registered User: Group)

    Also. I tried switching blogs, added same code in custom plugin, functions.php of theme. But, it gave no result.

    I can show you path for plugin where code is added. Can you have a look at it?

    Thanks

  • aristath
    • Recruit

    Hello again @Arin,

    Inside the plugin you will find a folder called email-newsletter-files/templates
    In that folder you will see that each template has its own folder.
    You can simply copy one of these default templates and hack the files in there to your liking.

    I hope that helps!

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.