From ab638e398e2609086960823ee6ad18ad02897278 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 8 Nov 2026 20:15:30 +0000 Subject: [PATCH] Add Word Document Download Option and Update Email Template Model - Introduced a new option to download document templates in Word (docx) format in the NewDocumentJob component. - Updated the EmailTemplate model to include 'docx' as a selectable format for email templates, enhancing document handling capabilities. --- .../Management/DocumentJobs/NewDocumentJob.jsx | 17 +++++++++++++++++ src/database/models/EmailTemplate.js | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx b/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx index 12cb0631..d182f1d8 100644 --- a/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx +++ b/src/components/Dashboard/Management/DocumentJobs/NewDocumentJob.jsx @@ -218,6 +218,23 @@ const NewDocumentJob = ({ onOk, defaultValues = {} }) => { } ) } + }, + { + label: 'Word', + key: 'docx', + onClick: () => { + setDownloading(true) + downloadTemplate( + objectData.documentTemplate._id, + objectData.documentTemplate.content, + toTemplateObjectData(objectData.objects), + fileName, + 'docx', + () => { + setDownloading(false) + } + ) + } } ] } diff --git a/src/database/models/EmailTemplate.js b/src/database/models/EmailTemplate.js index 09c7b273..58ae5dc2 100644 --- a/src/database/models/EmailTemplate.js +++ b/src/database/models/EmailTemplate.js @@ -387,7 +387,8 @@ export const EmailTemplate = { { value: 'pdf', label: 'PDF' }, { value: 'jpeg', label: 'JPEG' }, { value: 'png', label: 'PNG' }, - { value: 'svg', label: 'SVG' } + { value: 'svg', label: 'SVG' }, + { value: 'docx', label: 'Word' } ], value: (row) => { if (row?.type === 'documentTemplate') {