Skip to content
Snippets Groups Projects
Commit 2f234f6c authored by Karl Prieb's avatar Karl Prieb
Browse files

Add <html> tags to email header and footer

parent caeea792
No related merge requests found
RocketChat.Migrations.add({
version: 95,
up() {
if (RocketChat && RocketChat.models && RocketChat.models.Settings) {
const emailHeader = RocketChat.models.Settings.findOne({ _id: 'Email_Header' });
const emailFooter = RocketChat.models.Settings.findOne({ _id: 'Email_Footer' });
const startWithHTML = emailHeader.value.match(/^<html>/);
const endsWithHTML = emailFooter.value.match(/<\/hmtl>$/);
if (!startWithHTML) {
RocketChat.models.Settings.update(
{ _id: 'Email_Header' },
{ $set: { value: `<html>${ emailHeader.value }`} }
);
}
if (!endsWithHTML) {
RocketChat.models.Settings.update(
{ _id: 'Email_Footer' },
{ $set: { value: `${ emailFooter.value }</hmtl>`} }
);
}
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment