chore: Move from inline-css -> css-inline (#6252)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import inlineCss from "inline-css";
|
||||
import * as React from "react";
|
||||
import { NotificationEventType } from "@shared/types";
|
||||
import { Day } from "@shared/utils/time";
|
||||
import env from "@server/env";
|
||||
import { Collection, Comment, Document } from "@server/models";
|
||||
import DocumentHelper from "@server/models/helpers/DocumentHelper";
|
||||
import HTMLHelper from "@server/models/helpers/HTMLHelper";
|
||||
import NotificationSettingsHelper from "@server/models/helpers/NotificationSettingsHelper";
|
||||
import ProsemirrorHelper from "@server/models/helpers/ProsemirrorHelper";
|
||||
import BaseEmail, { EmailProps } from "./BaseEmail";
|
||||
@@ -83,12 +82,7 @@ export default class CommentCreatedEmail extends BaseEmail<
|
||||
|
||||
if (content) {
|
||||
// inline all css so that it works in as many email providers as possible.
|
||||
body = await inlineCss(content, {
|
||||
url: env.URL,
|
||||
applyStyleTags: true,
|
||||
applyLinkTags: false,
|
||||
removeStyleTags: true,
|
||||
});
|
||||
body = HTMLHelper.inlineCSS(content);
|
||||
}
|
||||
|
||||
const isReply = !!comment.parentCommentId;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import inlineCss from "inline-css";
|
||||
import * as React from "react";
|
||||
import { NotificationEventType } from "@shared/types";
|
||||
import { Day } from "@shared/utils/time";
|
||||
import env from "@server/env";
|
||||
import { Collection, Comment, Document } from "@server/models";
|
||||
import DocumentHelper from "@server/models/helpers/DocumentHelper";
|
||||
import HTMLHelper from "@server/models/helpers/HTMLHelper";
|
||||
import NotificationSettingsHelper from "@server/models/helpers/NotificationSettingsHelper";
|
||||
import ProsemirrorHelper from "@server/models/helpers/ProsemirrorHelper";
|
||||
import BaseEmail, { EmailProps } from "./BaseEmail";
|
||||
@@ -75,12 +74,7 @@ export default class CommentMentionedEmail extends BaseEmail<
|
||||
|
||||
if (content) {
|
||||
// inline all css so that it works in as many email providers as possible.
|
||||
body = await inlineCss(content, {
|
||||
url: env.URL,
|
||||
applyStyleTags: true,
|
||||
applyLinkTags: false,
|
||||
removeStyleTags: true,
|
||||
});
|
||||
body = HTMLHelper.inlineCSS(content);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import inlineCss from "inline-css";
|
||||
import * as React from "react";
|
||||
import { NotificationEventType } from "@shared/types";
|
||||
import { Day } from "@shared/utils/time";
|
||||
import env from "@server/env";
|
||||
import { Document, Collection, Revision } from "@server/models";
|
||||
import DocumentHelper from "@server/models/helpers/DocumentHelper";
|
||||
import HTMLHelper from "@server/models/helpers/HTMLHelper";
|
||||
import NotificationSettingsHelper from "@server/models/helpers/NotificationSettingsHelper";
|
||||
import SubscriptionHelper from "@server/models/helpers/SubscriptionHelper";
|
||||
import BaseEmail, { EmailProps } from "./BaseEmail";
|
||||
@@ -73,14 +72,7 @@ export default class DocumentPublishedOrUpdatedEmail extends BaseEmail<
|
||||
});
|
||||
|
||||
// inline all css so that it works in as many email providers as possible.
|
||||
body = content
|
||||
? await inlineCss(content, {
|
||||
url: env.URL,
|
||||
applyStyleTags: true,
|
||||
applyLinkTags: false,
|
||||
removeStyleTags: true,
|
||||
})
|
||||
: undefined;
|
||||
body = content ? HTMLHelper.inlineCSS(content) : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user