Is there a hook that I could put in place of bp_core_activated_user?

Top WooCommerce & WordPress Plugins Forums Email Verification for WooCommerce Is there a hook that I could put in place of bp_core_activated_user?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #101284
    Darryl
    Guest

    Hello! I am interested in buying this plugin, though I would like to know one thing.

    I currently run a BuddyPress site. Upon user signup, they need to verify their email address, just like the function of this plugin. I’ve created my own small plugin that sends members a welcome message immediately upon activation using the hook:
    add_action( ‘bp_core_activated_user’, ‘send_message_to_new_member’, 2 );

    If I were to use your plugin, is there a hook that I could put in place of bp_core_activated_user ?

    Kind Regards,
    – Dazza

    #101285
    Darryl
    Guest

    Please take a look here and suggest how I may be able to adapt and implement a hook: https://pastebin.com/5i7kG6Et ๐Ÿ™‚

    #101286
    WPFactory Plugins
    Participant
    Plugin Author

    Hello Darryl,

    I believe we have the hook you need:

    add_action( 'alg_wc_ev_user_account_activated', 'send_message_to_new_member')

    This hook uses just a $user_id parameter.

    Let me know if it helps ๐Ÿ˜‰

    #101287
    Darryl
    Guest

    Thanks for your response! If you look at my pastebin you’ll see that I already tried that, but unfortunately it does not work ๐Ÿ™ My code works with the previous hook, but not the one you have provided. Do you have any clues to why this might be?

    #101288
    WPFactory Plugins
    Participant
    Plugin Author

    Probably you need to remove the number 2 from the call.
    From:

    add_action( 'alg_wc_ev_user_account_activated', 'send_message_to_new_member', 2 );

    To:

    add_action( 'alg_wc_ev_user_account_activated', 'send_message_to_new_member' );
    

    Apart from that, can you please describe what’s not working?
    Do you know if the function is being called or if there is some error?

    #101289
    Darryl
    Guest

    I tried that, but no success. What should happen is that as soon as the user verifies their email address and becomes a verified member, they will be sent a message in BuddyPress. As I mentioned, the plugin works using a BuddyPress email verification hook — I figured that I could just swap the hook for the one you suggested and it would offer the same functionality, but seemingly not ๐Ÿค” Any tips would be appreciated!

    #101290
    WPFactory Plugins
    Participant
    Plugin Author

    In that case, please to increase the priority. Instead of 2, try to use 10 for example.
    And what would be the place you’re trying this code? It should be in functions.php.

    Also, please try to use a error_log() inside the function and check your debug.log to see if the function is being called or not.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.