iachat/app/javascript/dashboard/i18n/locale
Aguinaldo Tupy f03a52bd77
feat: Add media_name support for WhatsApp templates document files (#12462)
## Description

This implementation adds support for the `media_name` parameter for
WhatsApp document templates, resolving the issue where documents appear
as "untitled" when sent via templates.

**Problem solved:** Documents sent via WhatsApp templates always
appeared as "untitled" because Chatwoot didn't process the `filename`
field required by the WhatsApp API.

**Solution:** Added support for the `media_name` parameter that maps to
the WhatsApp API's `filename` field.

## Type of change

- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update

## How Has This Been Tested?

Created and executed **7 comprehensive test scenarios**:

1.  Document without `media_name` (backward compatibility)
2.  Document with valid `media_name`
3.  Document with blank `media_name`
4.  Document with null `media_name`
5.  Image with `media_name` (ignored as expected)
6.  Video with `media_name` (ignored as expected)
7.  Blank URL (returns nil appropriately)

**All tests passed** and confirmed **100% backward compatibility**.

## Technical Implementation

**Backend Changes:**
- `PopulateTemplateParametersService`: Added `media_name` parameter
support
- `TemplateProcessorService`: Pass `media_name` to parameter builder
- `WhatsappCloudService`: Updated documentation with `media_name`
example

**Frontend Changes:**
- `WhatsAppTemplateParser.vue`: Added UI field for document filename
input
- `templateHelper.js`: Include `media_name` for document templates
- `whatsappTemplates.json`: Added translation key for document name
placeholder

**Key Features:**
- 🔄 **100% Backward Compatible** - Existing templates continue working
- 📝 **Document Filename Support** - Users can specify custom filenames
- 🎯 **Document-Only Feature** - Only affects document media types
-  **Comprehensive Testing** - All edge cases covered

## Expected Behavior

**Before:**
```ruby
# All documents appear as "untitled"
{
  type: 'document',
  document: { link: 'https://example.com/document.pdf' }
}
```

**After:**
```ruby
# With media_name - displays custom filename
{
  type: 'document',
  document: {
    link: 'https://example.com/document.pdf',
    filename: 'Invoice_2025.pdf'
  }
}

# Without media_name - works as before
{
  type: 'document',
  document: { link: 'https://example.com/document.pdf' }
}
```

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream
modules

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2025-09-18 15:25:31 +05:30
..
am chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ar chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
az chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
bg chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ca chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
cs chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
da chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
de chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
el chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
en feat: Add media_name support for WhatsApp templates document files (#12462) 2025-09-18 15:25:31 +05:30
es chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
fa chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
fi chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
fr chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
he chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
hi chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
hr chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
hu chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
hy chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
id chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
is chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
it chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ja chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ka chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ko chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
lt chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
lv chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ml chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ms chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ne chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
nl chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
no chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
pl chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
pt chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
pt_BR chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ro chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ru chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sh chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sk chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sl chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sq chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sr chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
sv chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ta chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
th chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
tl chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
tr chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
uk chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ur chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
ur_IN chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
vi chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
zh chore: Update translations, add pnpm sync:i18n command (#10893) 2025-02-12 17:43:46 -08:00
zh_CN chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00
zh_TW chore: Update translations (#12371) 2025-09-12 14:33:40 -07:00