Method: Gitlab::Client::Users#add_email
- Defined in:
- lib/gitlab/client/users.rb
permalink #add_email(email, user_id = nil, skip_confirmation = nil) ⇒ Gitlab::ObjectifiedHash
Creates a new email Will create a new email an authorized user if no user ID passed.
244 245 246 247 248 249 250 251 |
# File 'lib/gitlab/client/users.rb', line 244 def add_email(email, user_id = nil, skip_confirmation = nil) url = user_id.to_i.zero? ? '/user/emails' : "/users/#{user_id}/emails" if skip_confirmation.nil? post(url, body: { email: email }) else post(url, body: { email: email, skip_confirmation: skip_confirmation }) end end |