chore: Prevent notification email loop (#3386)

Configuring an agent email also as a support email inbox leads to conversations getting created in a loop if notifications were also configured to the same email.
This commit is contained in:
Sojan Jose
2021-11-15 19:15:51 +05:30
committed by GitHub
parent e849759e15
commit acb06e7df6
4 changed files with 190 additions and 0 deletions

View File

@@ -28,4 +28,9 @@ module MailboxHelper
end
@message.save!
end
def notification_email_from_chatwoot?
# notification emails are send via mailer sender email address. so it should match
@processed_mail.original_sender == Mail::Address.new(ENV.fetch('MAILER_SENDER_EMAIL', 'Chatwoot <accounts@chatwoot.com>')).address
end
end