feat(whatsapp): add template listing to settings (#15312)
Account administrators can now browse synced WhatsApp message templates inside Settings without opening a provider dashboard. The page combines native WhatsApp and Twilio WhatsApp templates, with channel and language filters, search, a template preview drawer, and links to manage templates at the provider. Creating, updating, and deleting templates in Chatwoot remains out of scope for this first version. Related: https://linear.app/chatwoot/issue/PLA-193/add-whatsapp-template-listing-to-account-settings <img width="2742" height="1460" alt="CleanShot 2026-08-03 at 20 23 27@2x" src="https://github.com/user-attachments/assets/5d0b7a98-f882-425a-b9ec-7d631371959c" /> ### Things to know - This is stack 2 of 2 and depends on API draft #15311. - Review this PR against `codex/whatsapp-template-api`; after the API PR lands, this branch can be rebased and retargeted to `develop`. - Both native WhatsApp and Twilio WhatsApp template caches are supported. - Template management remains in Meta Business Portfolio or Twilio Console. ### How to test 1. Open Settings → WhatsApp templates for an account with native and Twilio WhatsApp inboxes. 2. Confirm templates from each inbox are listed with their status, language, category, channel, and last-updated metadata. 3. Filter by channel and language, and search by template name or content. 4. Open a template and confirm its preview renders in the drawer. 5. Use the provider action and confirm it opens the appropriate Meta or Twilio template-management page. 6. Confirm loading, empty, and error states remain usable. --------- Co-authored-by: Muhsin <12408980+muhsin-k@users.noreply.github.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -33,6 +33,13 @@ class Inboxes extends CacheEnabledApiClient {
|
||||
return axios.post(`${this.url}/${inboxId}/sync_templates`);
|
||||
}
|
||||
|
||||
getMessageTemplates(inboxId, params = {}, config = {}) {
|
||||
return axios.get(`${this.url}/${inboxId}/message_templates`, {
|
||||
...config,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
updateWhatsappBusinessManagementToken(inboxId, businessManagementToken) {
|
||||
return axios.put(
|
||||
`${this.url}/${inboxId}/whatsapp_business_management_token`,
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('#InboxesAPI', () => {
|
||||
expect(inboxesAPI).toHaveProperty('getAgentBot');
|
||||
expect(inboxesAPI).toHaveProperty('setAgentBot');
|
||||
expect(inboxesAPI).toHaveProperty('syncTemplates');
|
||||
expect(inboxesAPI).toHaveProperty('getMessageTemplates');
|
||||
});
|
||||
|
||||
describe('API calls', () => {
|
||||
@@ -50,6 +51,24 @@ describe('#InboxesAPI', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('#getMessageTemplates', () => {
|
||||
const controller = new AbortController();
|
||||
|
||||
inboxesAPI.getMessageTemplates(
|
||||
2,
|
||||
{ name: 'welcome' },
|
||||
{ signal: controller.signal }
|
||||
);
|
||||
|
||||
expect(axiosMock.get).toHaveBeenCalledWith(
|
||||
'/api/v1/inboxes/2/message_templates',
|
||||
{
|
||||
signal: controller.signal,
|
||||
params: { name: 'welcome' },
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it('#updateWhatsappBusinessManagementToken', () => {
|
||||
inboxesAPI.updateWhatsappBusinessManagementToken(2, 'business-token');
|
||||
expect(axiosMock.put).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user