Unset email address requirement on User Form not taking The scope of our project doesn't require users to have an email (they can use phone instead), therefore, I'm trying to unset the email requirement like so:
function my_module_form_user_form_alter(&amp;$form, &amp;$form_state, $form_id) {
   $form['account']['mail']['#required'] = false;
}

However, this doesn't seem to actually change the requirement because when I submit the form without an Email I still get the error Email field is required... I used kint to view the form object $form['account']['mail'] and it shows that the required attribute is set to false, yet I still get the error that it's required...
How can I make it so that I can save a user record without an email using this form?
The email field is one of the entity fields added by User::baseFieldDefinitions(), which sets it with a constraint.
$fields['mail'] = BaseFieldDefinition::create('email')
  -&gt;setLabel(t('Email'))
  -&gt;setDescription(t('The email of this user.'))
  -&gt;setDefaultValue('')
  -&gt;addConstraint('UserMailUnique')
  -&gt;addConstraint('UserMailRequired')
  -&gt;addConstraint('ProtectedUserField');

The UserMailRequired constraint does what its name suggest: It checks if the user's email address is provided if required. It isn't required if the account originally had no mail set and the user editing the account has the administer users permission.
That constraint needs to be removed from the entity field, to allow the email field to be empty. (It still necessary to mark the email form field as not required, though.)
use \Drupal\Core\Entity\EntityTypeInterface;

function mymodule_entity_base_field_info_alter(&amp;$fields, EntityTypeInterface $entity_type) {
  if ($entity_type-&gt;id() == 'user' &amp;&amp; !empty($fields['mail'])) {
    $constraints = $fields['mail']-&gt;getConstraints();
    unset($constraints['UserMailRequired']);
    $fields['mail']-&gt;setConstraints($constraints);
  }
}