diff --git a/.changeset/selfish-fishes-move.md b/.changeset/selfish-fishes-move.md new file mode 100644 index 000000000000..a227695cea89 --- /dev/null +++ b/.changeset/selfish-fishes-move.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixes mail export form "To additional emails" field validation diff --git a/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx b/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx index c7a3276ac8e1..b6f0e4b88bf2 100644 --- a/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx +++ b/apps/meteor/client/views/room/contextualBar/ExportMessages/MailExportForm.tsx @@ -155,11 +155,8 @@ const MailExportForm = ({ formId, rid, onCancel, exportOptions }: MailExportForm rules={{ validate: { validateEmail: (additionalEmails) => { - if (additionalEmails === '') { - return undefined; - } - - if (additionalEmails !== '' && validateEmail(additionalEmails)) { + const emails = additionalEmails?.split(',').map((email) => email.trim()); + if (Array.isArray(emails) && emails.every((email) => validateEmail(email.trim()))) { return undefined; }