chore: fix sla email notifications (#9192)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -61,10 +61,9 @@ class AgentNotifications::ConversationNotificationsMailer < ApplicationMailer
|
||||
user: @agent,
|
||||
conversation: @conversation,
|
||||
inbox: @conversation.inbox,
|
||||
message: @message,
|
||||
sla_policy: @sla_policy
|
||||
message: @message
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
AgentNotifications::ConversationNotificationsMailer.include_mod_with('AgentNotifications::ConversationNotificationsMailer')
|
||||
AgentNotifications::ConversationNotificationsMailer.prepend_mod_with('AgentNotifications::ConversationNotificationsMailer')
|
||||
|
||||
@@ -50,4 +50,4 @@ class ApplicationRecord < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
ApplicationRecord.include_mod_with('Enterprise::ApplicationRecord')
|
||||
ApplicationRecord.prepend_mod_with('ApplicationRecord')
|
||||
|
||||
@@ -29,4 +29,10 @@ module Enterprise::AgentNotifications::ConversationNotificationsMailer
|
||||
@action_url = app_account_conversation_url(account_id: @conversation.account_id, id: @conversation.display_id)
|
||||
send_mail_with_liquid(to: @agent.email, subject: "Conversation [ID - #{@conversation.display_id}] missed SLA for resolution time") and return
|
||||
end
|
||||
|
||||
def liquid_droppables
|
||||
super.merge({
|
||||
sla_policy: @sla_policy
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,6 +50,7 @@ class Sla::EvaluateAppliedSlaService
|
||||
end
|
||||
|
||||
def get_last_message_id(conversation)
|
||||
# TODO: refactor the method to fetch last message without reply
|
||||
conversation.messages.where(message_type: :incoming).last&.id
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user