iachat/app/javascript/dashboard/helper/specs
Muhsin Keloth 99997a701a
feat: Add twilio content templates (#12277)
Implements comprehensive Twilio WhatsApp content template support (Phase
1) enabling text, media, and quick reply templates with proper parameter
conversion, sync capabilities, and feature flag protection.

###  Features Implemented

  **Template Types Supported**

  - Basic Text Templates: Simple text with variables ({{1}}, {{2}})
  - Media Templates: Image/Video/Document templates with text variables
  - Quick Reply Templates: Interactive button templates
- Phase 2 (Future): List Picker, Call-to-Action, Catalog, Carousel,
Authentication templates

  **Template Synchronization**

- API Endpoint: POST
/api/v1/accounts/{account_id}/inboxes/{inbox_id}/sync_templates
  - Background Job: Channels::Twilio::TemplatesSyncJob
  - Storage: JSONB format in channel_twilio_sms.content_templates
  - Auto-categorization: UTILITY, MARKETING, AUTHENTICATION categories

 ###  Template Examples Tested


  #### Text template
```
  { "name": "greet", "language": "en" }
```
  #### Template with variables
```
  { "name": "order_status", "parameters": [{"type": "body", "parameters": [{"text": "John"}]}] }
```

  #### Media template with image
```
  { "name": "product_showcase", "parameters": [
    {"type": "header", "parameters": [{"image": {"link": "image.jpg"}}]},
    {"type": "body", "parameters": [{"text": "iPhone"}, {"text": "$999"}]}
  ]}
```
#### Preview

<img width="1362" height="1058" alt="CleanShot 2025-08-26 at 10 01
51@2x"
src="https://github.com/user-attachments/assets/cb280cea-08c3-44ca-8025-58a96cb3a451"
/>

<img width="1308" height="1246" alt="CleanShot 2025-08-26 at 10 02
02@2x"
src="https://github.com/user-attachments/assets/9ea8537a-61e9-40f5-844f-eaad337e1ddd"
/>

#### User guide

https://www.chatwoot.com/hc/user-guide/articles/1756195741-twilio-content-templates

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-08-29 16:13:25 +05:30
..
CacheHelper feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
fixtures chore: Remove defer attribute from widget-loader script (#11887) 2025-07-08 15:31:33 +05:30
actionCable.spec.js feat: Add stores for copilotMessages and copilotThreads (#11603) 2025-05-27 18:36:32 -06:00
actionQueryGenerator.spec.js feat: Add the ability to add new automation rule (#3459) 2022-02-02 18:46:07 +05:30
agentHelper.spec.js fix: Translate "None" option in agent assignment dropdown (#11060) 2025-03-11 14:49:27 -07:00
auditlogHelper.spec.js fix: TypeError: Cannot read properties of null (reading 'user_id') (#9884) 2024-08-07 14:42:01 +05:30
automationHelper.spec.js fix: Translate "None" option in automation select (#11076) 2025-03-13 16:44:46 -07:00
commons.spec.js fix: Variable search item not showing after braces/commas (#11864) 2025-07-03 19:39:36 +05:30
conversationHelper.spec.js feat: Rewrite conversations mixin to a helper (#9931) 2024-08-13 15:15:04 +05:30
customViewsHelper.spec.js fix: Edit custom views folder (#7670) 2023-08-04 13:54:21 +05:30
DOMHelpers.spec.js feat: add promise based loader for FB script (#9780) 2024-07-22 11:32:05 +05:30
downloadHelper.spec.js feat: Add business hours in downloadable reports (#4674) 2022-05-27 09:26:59 +05:30
editorContentHelper.spec.js feat: Add the ability to mention team in private message (#11758) 2025-07-02 19:57:59 +05:30
editorHelper.spec.js feat: Add the ability to mention team in private message (#11758) 2025-07-02 19:57:59 +05:30
filterQueryGenerator.spec.js feat: Custom attributes in automations and refactor (#4548) 2022-11-10 10:53:29 +05:30
flag.spec.js chore: Replace packages with native functions (#5140) 2022-08-03 17:08:21 +05:30
inbox.spec.js chore: Replace Thumbnail with Avatar (#12119) 2025-08-11 15:47:17 +05:30
inboxFixture.js feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
macrosFixtures.js feat: Add assign agent option in macro (#5821) 2022-11-09 09:52:48 -08:00
macrosHelper.spec.js chore(i18n): Improvements in automation and macros (#11231) 2025-04-02 15:48:42 -07:00
permissionsHelper.spec.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
portalHelper.spec.js fix: Add missing 'hc' path segment after custom domain in article URLs (#11353) 2025-04-22 21:53:50 +05:30
preChat.spec.js feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
ReconnectService.spec.js chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
routeHelpers.spec.js chore: Custom Roles to manage permissions [ UI ] (#9865) 2024-09-17 11:40:11 -07:00
snoozeHelpers.spec.js feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
templateHelper.spec.js feat: WhatsApp enhanced templates front end changes (#12117) 2025-08-12 18:53:19 +05:30
themeHelper.spec.js feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722) 2024-07-10 08:32:16 -07:00
uploadHelper.spec.js feat: Add the ability to paste images to editor (#10072) 2024-09-11 09:44:13 +05:30
URLHelper.spec.js feat: Add twilio content templates (#12277) 2025-08-29 16:13:25 +05:30
validations.spec.js chore: Remove unused files in contact (#10570) 2024-12-11 19:29:24 -08:00