Trying to create an user by mobile number


  • Used Zammad version: 5.2.x
  • Used Zammad installation type: package
  • Operating system: Debian 10
  • Browser + version: Chrome 10x

Expected behavior:

  • Our voicemail system creates tickets with the voicemail text and the attached audio. To do this, it looks up for existing users by phone number, if the user don’t exist, it will create a new user with the following data:

{"phone": "phone number","roles":["Customer"]}'

To have a outbound sms notification channel to the user, i check if the number is a mobile phone number. If so, then i want to create a new user with

{"mobile": "phone number","roles":["Customer"]}'

This is needed, because the sms notification only works, if the mobile field is filled with a phone number.

Actual behavior:

  • The backend throws an error, because only firstname, lastname, phone or email are accepted for creating new users:
	"error": "At least one identifier (firstname, lastname, phone or email) for user is required.",
	"error_human": "At least one identifier (firstname, lastname, phone or email) for user is required."

In /app/models/user.rb the function “ensure_identifier” checks for one of these types.

  def ensure_identifier
    return if login.present? && !login.start_with?('auto-')
    return if [email, firstname, lastname, phone].any?(&:present?)

    errors.add :base, __('At least one identifier (firstname, lastname, phone or email) for user is required.')

Is it possible, to expand the function to check for mobile also?

Like this:
return if [email, firstname, lastname, phone, mobile].any?(&:present?)

I believe that this would be a feature request. I personally do see the use case. I’ll notify PO maybe PO fancies this already.

1 Like

In my opinion in most cases the agent will not be able to work with only the phone number of the customer. At least a name must be entered to identify this number and/or prevent the number from occurring more often/more users being created. But of course I also see the usecase that the name is not known - but in that case I feel the workaround to choose “unidentified caller” as name is already helpful and not a big pain.

So I guess it would be nice to have but the workaround is for most cases sufficient, so it’s more in a lower priority.

This conflicts with the definition in “ensure_identifier”. There you can create an user only by phone number. (But not only by mobile number) When the customer is created, i already check, if the number is known by zammad and then i set the voicemail ticket to the corresponding user instead of creating a new user. If the agent calls back the customer, then the additional informations like name or address can be added to the customer.

At the moment i fill both fields (phone and mobile), if the caller number is a mobile number. I will have a look on my test environment, if i can add the 5th option to the function.

1 Like