Registering Users without Email

2 years 4 months ago - 2 years 4 months ago #327493 by MarlonFungai
[#8807] Registering Users without Email was created by MarlonFungai
Hi guys I am trying to allow users that don't have email addresses to register using their mobile phones. What I have done is make the email field not required on the registration form, added the phone field to registration and made that required and then created an field Auto Action that triggers onBeforeSaveRegistrationRequest and sets the email address to the phonenumber@default.domain. For some reason I am still getting an "The email address you entered is invalid. Please enter another email address."

Please Log in to join the conversation.

2 years 4 months ago #327494 by krileon
Replied by krileon on topic Registering Users without Email
The email address has to pass validation. If you're using a Field action on onBeforeSaveRegistrationRequest then you're also trying to trigger a premature user store. We don't have a fallback functionality for email fields only username fields. Joomla requires email address to function and so does CB in many regards so it can't be completely omitted from a new user create process. There isn't a trigger early enough with a user object to override this behavior.

Will see if I can improve the onStartSaveUserRegistration trigger to pass the new user object, which would allow for you to do what you're wanting using a Code action to modify the user object.

forge.joomlapolis.com/issues/8807


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: MarlonFungai

Please Log in to join the conversation.

2 years 4 months ago #327664 by MarlonFungai
Replied by MarlonFungai on topic Registering Users without Email
Have these changes been implemented in the latest update so I can try them?
The following user(s) said Thank You: Brussels

Please Log in to join the conversation.

2 years 4 months ago #327669 by krileon
Replied by krileon on topic Registering Users without Email
Yes, this has been implemented. The onStartSaveUserRegistration trigger now includes a reference object of the user being created. It's accessible with var1. You can use that trigger to set data on the user object that isn't being set by registration. Example as follows.

Global
Triggers: onStartSaveUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$variables['var1']->set( 'email', 'bypass@example.com' );
Parameters
References: Variable 1


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.168 seconds

Facebook Twitter LinkedIn