How to Generate a Unique Account ID
This document will guide you to have an auto-generated unique account ID for your users when they register. You can add an email placeholder or display the unique account ID on the email templates.
You'll need to customize it with UM Hooks on your end to get it done. You can try and use the sample code below:
Note: You can add the code snippet to your theme's functions.php file or use the Code Snippets plugin.
It will generate a unique ID. For example C-000123, C-000124, etc. The unique ID will be saved in the wp_usermeta table with the meta key um_unique_account_id
on registration.
How to Display in Profile Form
- To display the Account ID on the user's profile page, go to wp-admin> Ultimate Member> Forms> Edit Profile Form.
- Select Text Box or Textarea to set up a new field.
-
Add a new field to your form using the meta key: um_unique_account_id
- Once the field is added, click the Update button to save changes.
- The Account ID will now be displayed on the user's profile page after registration and activating their account.
Email placeholder
You can use this email placeholder to add to your email templates: {usermeta:um_unique_account_id}
- Go to wp-admin>Ultimate Member> Settings> Email tab. Select the email template you want to edit by clicking on the gear icon.
- Add the email placeholder {usermeta:um_unique_account_id} in the email template. Click on the Save Changes button to save.
-
The unique ID no. is displayed on the email sent to the user.
Warning: We have created this code example to provide guidance and to make it easier for you to implement this code into your website. However, we are not able to provide any support when it comes to customizing the plugin. If you need help implementing this code, please hire a developer.