fix: Outbound messages triggering out of office (#3051)

This commit is contained in:
Sojan Jose
2021-09-21 10:16:14 +05:30
committed by GitHub
parent dcbbb09ebd
commit aaadd61e09
2 changed files with 21 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ class MessageTemplates::HookExecutionService
def should_send_out_of_office_message?
# should not send if its a tweet message
return false if conversation.tweet?
# should not send for outbound messages
return false unless message.incoming?
inbox.out_of_office? && conversation.messages.today.template.empty? && inbox.out_of_office_message.present?
end