A. Two or more tabs, the first tab collects firstname, lastname and cb_birthdate, and click next.
You don't need CB Auto Actions for tabbed/stepped registration. This can be enabled within CB > Configuration > Registration by adjusting "Registration Layout" as needed.
B. The second tab has been auto-populated with values from firstname, lastname and cb_birthdate as an email address like: firstname@lastname.mmddyysixdigits as:
joseph@smith.080568
You'll just need to set the email field as non-required. Next you'll need to add the below CSS to suppress its display (it needs to be on the form so its post data can process).
Code:
.cbft_primaryemailaddress {
display: none !important;
}
Next the below CB Auto Actions action will generate the email post data to set its value.
Triggers: onBeforeSaveUserRegistrationRequest, onBeforeUserProfileSaveRequest
Action: Code
User: Automatic
Access: Everybody
Method: PHP
Code:
Code:
global $_POST;
$_POST['email'] = '[firstname]@[lastname].[cb_birthdate]';
$_POST['email_verify'] = $_POST['email'];
This should work for both registration and profile edit to ensure the email fields value maintains with name change, etc.. You can change the email value to whatever you like. For example the below will generate a random invalid email.
Code:
global $_POST;
$_POST['email'] = uniqid() . '@cb.invalid';
$_POST['email_verify'] = $_POST['email'];