CSAT scores are helpful, but on their own they rarely tell the full story. A drop in rating can come from delayed timelines, unclear expectations, or simple misunderstandings, even when the issue itself was handled correctly. Review Notes for CSAT let admins/report manager roles add internal-only context next to each CSAT response. This makes it easier to interpret scores properly and focus on patterns and root causes, not just numbers. <img width="2170" height="1680" alt="image" src="https://github.com/user-attachments/assets/56df7fab-d0a7-4a94-95b9-e4c459ad33d5" /> ### Why this matters * Capture the real context behind individual CSAT ratings * Clarify whether a low score points to a genuine service issue or a process gap * Spot recurring themes across conversations and teams * Make CSAT reviews more useful for leadership reviews and retrospectives ### How Review Notes work **View CSAT responses** Open the CSAT report to see overall metrics, rating distribution, and individual responses. **Add a Review Note** For any CSAT entry, managers can add a Review Note directly below the customer’s feedback. **Document internal insights** Use Review Notes to capture things like: * Why a score was lower or higher than expected * Patterns you are seeing across similar cases * Observations around communication, timelines, or customer expectations Review Notes are visible only to administrators and people with report access only. We may expand visibility to agents in the future based on feedback. However, customers never see them. Each note clearly shows who added it and when, making it easy to review context and changes over time.
55 lines
2.0 KiB
Ruby
55 lines
2.0 KiB
Ruby
class Api::V1::Accounts::CsatSurveyResponsesController < Api::V1::Accounts::BaseController
|
|
include Sift
|
|
include DateRangeHelper
|
|
|
|
RESULTS_PER_PAGE = 25
|
|
|
|
before_action :check_authorization
|
|
before_action :set_csat_survey_responses, only: [:index, :metrics, :download]
|
|
before_action :set_current_page, only: [:index]
|
|
before_action :set_current_page_surveys, only: [:index]
|
|
before_action :set_total_sent_messages_count, only: [:metrics]
|
|
|
|
sort_on :created_at, type: :datetime
|
|
|
|
def index; end
|
|
|
|
def metrics
|
|
@total_count = @csat_survey_responses.count
|
|
@ratings_count = @csat_survey_responses.group(:rating).count
|
|
end
|
|
|
|
def download
|
|
response.headers['Content-Type'] = 'text/csv'
|
|
response.headers['Content-Disposition'] = 'attachment; filename=csat_report.csv'
|
|
render layout: false, template: 'api/v1/accounts/csat_survey_responses/download', formats: [:csv]
|
|
end
|
|
|
|
private
|
|
|
|
def set_total_sent_messages_count
|
|
@csat_messages = Current.account.messages.input_csat
|
|
@csat_messages = @csat_messages.where(created_at: range) if range.present?
|
|
@total_sent_messages_count = @csat_messages.count
|
|
end
|
|
|
|
def set_csat_survey_responses
|
|
base_query = Current.account.csat_survey_responses.includes([:conversation, :assigned_agent, :contact])
|
|
@csat_survey_responses = filtrate(base_query).filter_by_created_at(range)
|
|
.filter_by_assigned_agent_id(params[:user_ids])
|
|
.filter_by_inbox_id(params[:inbox_id])
|
|
.filter_by_team_id(params[:team_id])
|
|
.filter_by_rating(params[:rating])
|
|
end
|
|
|
|
def set_current_page_surveys
|
|
@csat_survey_responses = @csat_survey_responses.page(@current_page).per(RESULTS_PER_PAGE)
|
|
end
|
|
|
|
def set_current_page
|
|
@current_page = params[:page] || 1
|
|
end
|
|
end
|
|
|
|
Api::V1::Accounts::CsatSurveyResponsesController.prepend_mod_with('Api::V1::Accounts::CsatSurveyResponsesController')
|