feat: hide CSAT survey URLs from agents in dashboard (#11622)

This commit is contained in:
Muhsin Keloth
2025-06-11 23:39:47 +05:30
committed by GitHub
parent 5745a55db5
commit f627dbe42d
15 changed files with 148 additions and 46 deletions

View File

@@ -93,7 +93,7 @@ class Whatsapp::Providers::BaseService
def create_button_payload(message)
buttons = create_buttons(message.content_attributes['items'])
json_hash = { 'buttons' => buttons }
create_payload('button', message.content, JSON.generate(json_hash))
create_payload('button', message.outgoing_content, JSON.generate(json_hash))
end
def create_list_payload(message)
@@ -101,6 +101,6 @@ class Whatsapp::Providers::BaseService
section1 = { 'rows' => rows }
sections = [section1]
json_hash = { :button => 'Choose an item', 'sections' => sections }
create_payload('list', message.content, JSON.generate(json_hash))
create_payload('list', message.outgoing_content, JSON.generate(json_hash))
end
end

View File

@@ -63,7 +63,7 @@ class Whatsapp::Providers::Whatsapp360DialogService < Whatsapp::Providers::BaseS
headers: api_headers,
body: {
to: phone_number,
text: { body: message.content },
text: { body: message.outgoing_content },
type: 'text'
}.to_json
)
@@ -77,7 +77,7 @@ class Whatsapp::Providers::Whatsapp360DialogService < Whatsapp::Providers::BaseS
type_content = {
'link': attachment.download_url
}
type_content['caption'] = message.content unless %w[audio sticker].include?(type)
type_content['caption'] = message.outgoing_content unless %w[audio sticker].include?(type)
type_content['filename'] = attachment.file.filename if type == 'document'
response = HTTParty.post(

View File

@@ -82,7 +82,7 @@ class Whatsapp::Providers::WhatsappCloudService < Whatsapp::Providers::BaseServi
messaging_product: 'whatsapp',
context: whatsapp_reply_context(message),
to: phone_number,
text: { body: message.content },
text: { body: message.outgoing_content },
type: 'text'
}.to_json
)
@@ -96,7 +96,7 @@ class Whatsapp::Providers::WhatsappCloudService < Whatsapp::Providers::BaseServi
type_content = {
'link': attachment.download_url
}
type_content['caption'] = message.content unless %w[audio sticker].include?(type)
type_content['caption'] = message.outgoing_content unless %w[audio sticker].include?(type)
type_content['filename'] = attachment.file.filename if type == 'document'
response = HTTParty.post(
"#{phone_id_path}/messages",

View File

@@ -61,7 +61,7 @@ class Whatsapp::SendOnWhatsappService < Base::SendOnChannelService
return if body_object.blank?
template_match_regex = build_template_match_regex(body_object['text'])
message.content.match(template_match_regex)
message.outgoing_content.match(template_match_regex)
end
def build_template_match_regex(template_text)