feat: hide CSAT survey URLs from agents in dashboard (#11622)
This commit is contained in:
@@ -34,7 +34,7 @@ class Channel::Sms < ApplicationRecord
|
||||
end
|
||||
|
||||
def send_message(contact_number, message)
|
||||
body = message_body(contact_number, message.content)
|
||||
body = message_body(contact_number, message.outgoing_content)
|
||||
body['media'] = message.attachments.map(&:download_url) if message.attachments.present?
|
||||
|
||||
send_to_bandwidth(body, message)
|
||||
|
||||
@@ -33,7 +33,7 @@ class Channel::Telegram < ApplicationRecord
|
||||
end
|
||||
|
||||
def send_message_on_telegram(message)
|
||||
message_id = send_message(message) if message.content.present?
|
||||
message_id = send_message(message) if message.outgoing_content.present?
|
||||
message_id = Telegram::SendAttachmentsService.new(message: message).perform if message.attachments.present?
|
||||
message_id
|
||||
end
|
||||
@@ -95,7 +95,7 @@ class Channel::Telegram < ApplicationRecord
|
||||
end
|
||||
|
||||
def send_message(message)
|
||||
response = message_request(chat_id(message), message.content, reply_markup(message), reply_to_message_id(message))
|
||||
response = message_request(chat_id(message), message.outgoing_content, reply_markup(message), reply_to_message_id(message))
|
||||
process_error(message, response)
|
||||
response.parsed_response['result']['message_id'] if response.success?
|
||||
end
|
||||
|
||||
@@ -181,17 +181,9 @@ class Message < ApplicationRecord
|
||||
data
|
||||
end
|
||||
|
||||
def content
|
||||
# move this to a presenter
|
||||
return self[:content] if !input_csat? || inbox.web_widget?
|
||||
|
||||
survey_link = "#{ENV.fetch('FRONTEND_URL', nil)}/survey/responses/#{conversation.uuid}"
|
||||
|
||||
if inbox.csat_config&.dig('message').present?
|
||||
"#{inbox.csat_config['message']} #{survey_link}"
|
||||
else
|
||||
I18n.t('conversations.survey.response', link: survey_link)
|
||||
end
|
||||
# Method to get content with survey URL for outgoing channel delivery
|
||||
def outgoing_content
|
||||
MessageContentPresenter.new(self).outgoing_content
|
||||
end
|
||||
|
||||
def email_notifiable_message?
|
||||
|
||||
Reference in New Issue
Block a user