chore: Enable email channel (#1851)
This commit is contained in:
@@ -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: email)
|
||||
channel = Channel::Email.find_by('email = ? OR forward_to_email = ?', email, email)
|
||||
if channel.present?
|
||||
is_a_support_email = true
|
||||
break
|
||||
@@ -37,7 +37,10 @@ class ApplicationMailbox < ActionMailbox::Base
|
||||
end
|
||||
|
||||
# routing should be defined below the referenced procs
|
||||
|
||||
# routes as a reply to existing conversations
|
||||
routing(reply_mail? => :reply)
|
||||
# routes as a new conversation in email channel
|
||||
routing(support_mail? => :support)
|
||||
routing(catch_all_mail? => :default)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user