The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/migrations/v095.js

28 lines
719 B

import { Migrations } from '../../../app/migrations';
import { Settings } from '../../../app/models';
Migrations.add({
version: 95,
up() {
if (Settings) {
const emailHeader = Settings.findOne({ _id: 'Email_Header' });
const emailFooter = Settings.findOne({ _id: 'Email_Footer' });
const startWithHTML = emailHeader.value.match(/^<html>/);
const endsWithHTML = emailFooter.value.match(/<\/html>$/);
if (!startWithHTML) {
Settings.update(
{ _id: 'Email_Header' },
{ $set: { value: `<html>${ emailHeader.value }` } }
);
}
if (!endsWithHTML) {
Settings.update(
{ _id: 'Email_Footer' },
{ $set: { value: `${ emailFooter.value }</html>` } }
);
}
}
},
});