fix: Emails not delivered when case does not match

Fixes #2504
This commit is contained in:
Tejaswini Chile
2021-09-17 22:14:39 +05:30
committed by GitHub
parent 0c3e8b6dbd
commit 6ad5a7452c
4 changed files with 13 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ class SupportMailbox < ApplicationMailbox
def find_channel
mail.to.each do |email|
@channel = Channel::Email.find_by('email = ? OR forward_to_email = ?', email, email)
@channel = Channel::Email.find_by('lower(email) = ? OR lower(forward_to_email) = ?', email.downcase, email.downcase)
break if @channel.present?
end
raise 'Email channel/inbox not found' if @channel.nil?