chore: Add timeouts to requests (#2024)

This commit is contained in:
Sojan Jose
2021-03-31 16:39:57 +05:30
committed by GitHub
parent f5a961b27c
commit c8b81b066b
5 changed files with 24 additions and 10 deletions

View File

@@ -29,13 +29,13 @@ class AgentNotifications::ConversationNotificationsMailer < ApplicationMailer
send_mail_with_liquid(to: @agent.email, subject: subject) and return
end
def assigned_conversation_new_message(conversation, agent)
def assigned_conversation_new_message(message, agent)
return unless smtp_config_set_or_development?
# Don't spam with email notifications if agent is online
return if ::OnlineStatusTracker.get_presence(conversation.account.id, 'User', agent.id)
return if ::OnlineStatusTracker.get_presence(message.account_id, 'User', agent.id)
@agent = agent
@conversation = conversation
@conversation = message.conversation
subject = "#{@agent.available_name}, New message in your assigned conversation [ID - #{@conversation.display_id}]."
@action_url = app_account_conversation_url(account_id: @conversation.account_id, id: @conversation.display_id)
send_mail_with_liquid(to: @agent.email, subject: subject) and return