[FIX] "to users" not working in export message (#23576)

* fixed export emails

* added types

* Update app/mailer/server/api.ts

Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com>

* fixed types

Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com>
pull/23389/head
Leonardo Ostjen Couto 4 years ago committed by GitHub
parent fce342cd66
commit 6146806bac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/mailer/server/api.ts
  2. 2
      client/views/room/contextualBar/ExportMessages/MailExportForm.js

@ -132,7 +132,7 @@ settings.watchMultiple(['Email_Header', 'Email_Footer'], () => {
export const rfcMailPatternWithName = /^(?:.*<)?([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)(?:>?)$/;
export const checkAddressFormat = (from: string): boolean => rfcMailPatternWithName.test(from);
export const checkAddressFormat = (adresses: string | string[]): boolean => ([] as string[]).concat(adresses).every((address) => rfcMailPatternWithName.test(address));
export const sendNoWrap = ({
to,
@ -152,7 +152,7 @@ export const sendNoWrap = ({
headers?: string;
}): void => {
if (!checkAddressFormat(to)) {
return;
throw new Meteor.Error('invalid email');
}
if (!text) {

@ -111,7 +111,7 @@ const MailExportForm = ({ onCancel, rid }) => {
await roomsExport({
rid,
type: 'email',
toUsers: [toUsers],
toUsers,
toEmails: additionalEmails.split(','),
subject,
messages: selectedMessages,

Loading…
Cancel
Save