fix: Display message content for CSAT messages in non-widget inboxes (#11528)

We made so many improvements for CSAT via https://github.com/chatwoot/chatwoot/pull/11485. However, we missed showing message content in the dashboard for CSAT URLs created in non-widget inboxes. This PR fixes the issue by ensuring that CSAT-configured messages are passed along with CSAT responses, otherwise defaulting to the translation.
This commit is contained in:
Muhsin Keloth
2025-05-21 04:09:18 +05:30
committed by GitHub
parent ccb3672ff8
commit 27ec791353
2 changed files with 38 additions and 1 deletions

View File

@@ -185,7 +185,13 @@ class Message < ApplicationRecord
# move this to a presenter
return self[:content] if !input_csat? || inbox.web_widget?
I18n.t('conversations.survey.response', link: "#{ENV.fetch('FRONTEND_URL', nil)}/survey/responses/#{conversation.uuid}")
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
end
def email_notifiable_message?