• Resolved gamicord

    (@gamicord)


    Hello Sir,
    You guys have worked with me to create a function on my website, which helps me to create a Custom User ID for my Users during Registration, using your UsersWP plugin.

    See it here– https://prnt.sc/5BLdB97yvxnm

    The challenge now, is that I want to show this Custom User ID in the body of the Email that is sent to my Users when they Register.

    I added the Shortcode in the Email Body, but it did not work. See it here– https://prnt.sc/l4OYk467BPKc

    Please, how do I get the Custom generated User ID to display inside the Email Body of the Message sent to my Users when they Register on my website through UsersWP plugin?

    Needing to hear from you soon.

    Regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support alexrollin

    (@alexrollin)

    Hello,

    UsersWP does not currently have this feature, but we will take this up as a feature request.

    If you have more questions please feel free to make a ticket here:

    https://userswp.io/support/

    Thread Starter gamicord

    (@gamicord)

    You guys can be very funny sometimes πŸ˜‚

    The last time I asked for the possibility of Custom User Identification Number, using UsersWP, your support team was quick to wave it off by telling me that it’s beyond the scope of support.

    But I wasn’t going to take “No” for an answer.

    So I pressed harder, and supplied the code, and you guys found a way to make my request a possibility.

    Even though UsersWP doesn’t come with that Feature, yet that feature works on my own website–because I and you agreed to make it work.

    Now, when my users register with UsersWP on my website, they get a Custom User ID as you can see here– https://prnt.sc/5BLdB97yvxnm

    While you were quick to tell me how it was not possible, my tenacity and refusal to accept impossibility from you, helped me and you to subconsciously add a new feature to your plugin.

    MOVING FORWARD

    Today, here I am again, asking you to make it possible for the User ID that is “generated during Registration“, to get shown in the Email Body sent to users, and you’ve started again with that your talk of impossibility.

    You see, UsersWP is your Product– It is your brain child– And everything in it, was placed there by You.

    In operation, You were able to make it accept tags written like this [##username##], and it will output Username in the Email Body.

    So what I am asking from you, is not something new. It is something that you’ve already done.

    Just that you’ve not written a Tag function into the plugin, that will output the value of your Shortcode Profile Tab.

    Your Shortcode Profile Tab is already existing. And You already have Tags expressed this way [##tag##] that can be outputted in the Email Body.

    Simply add one more function to the Core of UsersWP— to make it output the Value in the Shortcode Profile Tab, then show this value in the Email Body sent to the registered user, is all I ask.

    it is not something new. It is what you’ve already done before.

    Alternatively, you can just send me the PHP Code Snippets that I can add to my Functions.PHP file to make it happen.

    RESEARCH INTO THE MATTER
    Here’s a little bit of research I conducted on the matter— ( https://wordpress.stackexchange.com/questions/325023/can-i-use-shortcodes-in-mail-body )

    You can see the Code there, that it’s not so many. This suggests to my mind that the code needed to achieve this thing may not even be so hard and so stressful.

    Plus, you can see this as an indication that other people have needed what I am today asking for.

    I believe that link can be a guide to help you know what to do.

    Needing to hear from you soon.

    Regards.

    Plugin Contributor Paolo

    (@paoltaia)

    Nothing is impossible with custom code, but you have to consider that our time has value too.

    Adding the ID to the profile page through a shortcode was an easy enough customization that took me 5 minutes to accomplish with AI.

    What you are requesting now unfortunately is not as easy.

    If a customization can be done in a relatively short time, we are always available to help.

    If the customization requested takes a lot longer, we might not be able to do the same and that is not something a user should pretend that we do for free and on the spot.

    The link you provided has nothing to do with how UsersWP works. It’s generic for WordPress.

    I asked to the developers to have a look at your request and if they can come up with a quick snippet they will, otherwise you’ll need to hire a developer to help you out with this customization.

    We will let you know as soon as possible.

    Thanks for your patience,

    Plugin Author Stiofan

    (@stiofansisland)

    Going by the last example given which looks like it was just using the WP standard user ID (but your example looks custom?)

    add_filter('uwp_email_format_text','_my_custom_email_vars', 10, 3);
    function _my_custom_email_vars($replace_array, $content, $user_id){
        
        $replace_array['[#user_id#]'] = absint( $user_id );
    
        return $replace_array;
    }

    Let me know if you have used a custom field as that would require a new example.

    Thanks,

    Stiofan

    Thread Starter gamicord

    (@gamicord)

    @stiofansisland

    Going by the last example given which looks like it was just using the WP standard user ID (but your example looks custom?)

    Yes Sir, my example is custom. I used Custom Code to achieve it.

    However, the process is that I supplied a Code which I have, to someone in your support Team. Then you guys found a way to help me modify the Code, to make it work with UsersWP.

    So I was able to achieve a Custom User ID that looks like this– https://prnt.sc/A_b6kJeQTtQX

    All that remains now, is to be able to output the generated Custom User ID inside the Email Body that is sent to my Registered Users.

    1.) I modified the Code you sent me. I changed [#user_id#] to [#custom_user_id#], and it seemed to work.

    The only problem is that it stripped off all the Prefix and Suffix that came with the Custom ID.

    Here’s what Users receive– https://prnt.sc/acpvl6-ctJkY

    This is what is on their Profile– https://prnt.sc/A_b6kJeQTtQX

    You can see that the Email returns only the Integer Value, which is 9. Whereas, in the Profile, it has Prefixes and Suffixes that makes it look like this– MV-0009 |BN1

    I think the reason it is returning only the number 9 in the Custom ID, is because of the “absint” command in the code, making it return only integer. I think it needs to return this output as a String.

    Then the PHP snippet you sent, also needs to allow all the Prefixes and Suffixes to be added to the number as well.

    2.) I treat that my Custom User ID Code as a sort of Intellectual Property.

    So I won’t want to paste it here. I will appreciate if you can send me a link or maybe Email, where I can privately reach you, so that I can send you the whole code, for you to have a look at it.

    Probably when you see the whole code, you would have an idea of how to write a PHP Snippet that can work in reference to that code, to help me get what I want.

    Regards.

    Plugin Author Stiofan

    (@stiofansisland)

    Please open a ticket here https://userswp.io/support/
    Add “FAO Stiofan” to the subject and a team member will assign it to me.

    Thanks,

    Stiofan

    Thread Starter gamicord

    (@gamicord)

    @stiofansisland

    Hello Sir,

    I have sent a Support Ticket at that address ( https://userswp.io/support ) and I added β€œFAO Stiofan” to the Subject, as you instructed me.

    The Code was also added to the message.

    Thanks for your help and understanding, as I look forward to hearing from you soon.

    Regards.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Show Custom Code in Email Body’ is closed to new replies.