Reduced complexity (not needed code).
This commit is contained in:
parent
e4a731dcad
commit
42b45e50c1
1 changed files with 4 additions and 8 deletions
|
@ -8,19 +8,15 @@ module Channel::Filter::IdentifySender
|
|||
customer_user = nil
|
||||
if !customer_user_id.empty?
|
||||
customer_user = User.lookup(id: customer_user_id)
|
||||
if !customer_user
|
||||
Rails.logger.debug "Invalid x-zammad-customer-id header '#{customer_user_id}', no such user."
|
||||
else
|
||||
if customer_user
|
||||
Rails.logger.debug "Took customer form x-zammad-customer-id header '#{customer_user_id}'."
|
||||
if customer_user
|
||||
create_recipients(mail)
|
||||
return
|
||||
end
|
||||
else
|
||||
Rails.logger.debug "Invalid x-zammad-customer-id header '#{customer_user_id}', no such user."
|
||||
end
|
||||
end
|
||||
|
||||
# check if sender exists in database
|
||||
if !mail[ 'x-zammad-customer-login'.to_sym ].empty?
|
||||
if !customer_user && !mail[ 'x-zammad-customer-login'.to_sym ].empty?
|
||||
customer_user = User.find_by(login: mail[ 'x-zammad-customer-login'.to_sym ])
|
||||
end
|
||||
if !customer_user && !mail[ 'x-zammad-customer-email'.to_sym ].empty?
|
||||
|
|
Loading…
Reference in a new issue