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

@@ -22,7 +22,7 @@ class ApplicationMailbox < ActionMailbox::Base
proc do |inbound_mail_obj|
is_a_support_email = false
inbound_mail_obj.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)
if channel.present?
is_a_support_email = true
break