code: func (api UsersAPI) RegisterNewEmailAddress(w http.ResponseWriter, r *http.Request) {
  	username := mux.Vars(r)["username"]
  	body := user.EmailAddress{}
  	lang := r.FormValue("lang")
  	if lang == "" {
  		lang = organization.DefaultLanguage
  	}
  
  	if err := json.NewDecoder(r.Body).Decode(&body); err != nil || !body.Validate() {
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  
  	// Convert email address to lowercase
  	body.EmailAddress = strings.ToLower(body.EmailAddress)
  
  	if !body.Validate() {
  		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
  		return
  	}
  
  	userMgr := user.NewManager(r)
  	u, err := userMgr.GetByName(username)
  	if handleServerError(w, "getting user by name", err) {
  		return
  	}
  
  	if _, err := u.GetEmailAddressByLabel(body.Label); err == nil {
  		writeErrorResponse(w, http.StatusConflict, "duplicate_label")
  		return
  	}
  
  	err = userMgr.SaveEmail(username, body)
  	if handleServerError(w, "saving email", err) {
  		return
  	}
  
  	valMgr := validationdb.NewManager(r)
  	validated, err := valMgr.IsEmailAddressValidated(username, body.EmailAddress)
  	if handleServerError(w, "checking if email address is validated", err) {
  		return
  	}
  	if !validated {
  		_, err = api.EmailAddressValidationService.RequestValidation(r, username, body.EmailAddress, fmt.Sprintf("https://%s/emailvalidation", r.Host), lang)
  	}
  	w.Header().Set("Content-Type", "application/json")
  
  	w.WriteHeader(http.StatusCreated)
  	json.NewEncoder(w).Encode(body)
  }
docs: // RegisterNewEmailAddress is the handler for POST /users/{username}/emailaddresses
  // Register a new email address