CSAT templates for WhatsApp are submitted as Utility, but Meta may reclassify them as Marketing based on content, which can significantly increase messaging costs. This PR introduces a Captain-powered CSAT template analyzer for WhatsApp/Twilio WhatsApp that predicts utility fit, explains likely risks, and suggests safer rewrites before submission. The flow is manual (button-triggered), Captain-gated, and applies rewrites only on explicit user action. It also updates UX copy to clearly set expectations: the system submits as Utility, Meta makes the final categorization decision. Fixes https://linear.app/chatwoot/issue/CW-6424/ai-powered-whatsapp-template-classifier-for-csat-submissions https://github.com/user-attachments/assets/8fd1d6db-2f91-447c-9771-3de271b16fd9
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
/* global axios */
|
|
import CacheEnabledApiClient from './CacheEnabledApiClient';
|
|
|
|
class Inboxes extends CacheEnabledApiClient {
|
|
constructor() {
|
|
super('inboxes', { accountScoped: true });
|
|
}
|
|
|
|
// eslint-disable-next-line class-methods-use-this
|
|
get cacheModelName() {
|
|
return 'inbox';
|
|
}
|
|
|
|
getCampaigns(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/campaigns`);
|
|
}
|
|
|
|
deleteInboxAvatar(inboxId) {
|
|
return axios.delete(`${this.url}/${inboxId}/avatar`);
|
|
}
|
|
|
|
getAgentBot(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/agent_bot`);
|
|
}
|
|
|
|
setAgentBot(inboxId, botId) {
|
|
return axios.post(`${this.url}/${inboxId}/set_agent_bot`, {
|
|
agent_bot: botId,
|
|
});
|
|
}
|
|
|
|
syncTemplates(inboxId) {
|
|
return axios.post(`${this.url}/${inboxId}/sync_templates`);
|
|
}
|
|
|
|
createCSATTemplate(inboxId, template) {
|
|
return axios.post(`${this.url}/${inboxId}/csat_template`, {
|
|
template,
|
|
});
|
|
}
|
|
|
|
getCSATTemplateStatus(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/csat_template`);
|
|
}
|
|
|
|
analyzeCSATTemplateUtility(inboxId, template) {
|
|
return axios.post(`${this.url}/${inboxId}/csat_template/analyze`, {
|
|
template,
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new Inboxes();
|