mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-21 16:09:12 +03:00
Show full mention message in email and telegram (#6473)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
fe8bf16e77
commit
04e93939f6
@ -78,7 +78,7 @@ import serverNotification, {
|
||||
SenderInfo
|
||||
} from '@hcengineering/server-notification'
|
||||
import serverView from '@hcengineering/server-view'
|
||||
import { markupToText, stripTags } from '@hcengineering/text'
|
||||
import { markupToHTML, markupToText, stripTags } from '@hcengineering/text'
|
||||
import { encodeObjectURI } from '@hcengineering/view'
|
||||
import { workbenchId } from '@hcengineering/workbench'
|
||||
import webpush, { WebPushError } from 'web-push'
|
||||
@ -234,6 +234,14 @@ export async function getContentByTemplate (
|
||||
? await getTranslatedNotificationContent(notificationData, notificationData._class, control)
|
||||
: {}
|
||||
|
||||
if (
|
||||
notificationData !== undefined &&
|
||||
control.hierarchy.isDerived(notificationData._class, notification.class.MentionInboxNotification)
|
||||
) {
|
||||
const text = (notificationData as MentionInboxNotification).messageHtml
|
||||
params.body = text !== undefined ? markupToHTML(text) : params.body
|
||||
}
|
||||
|
||||
if (message !== undefined) {
|
||||
const markup = await messageToMarkup(control, message)
|
||||
params.message = markup !== undefined ? markupToText(markup) : params.message ?? ''
|
||||
|
@ -30,8 +30,13 @@ import {
|
||||
TxProcessor
|
||||
} from '@hcengineering/core'
|
||||
import { TriggerControl } from '@hcengineering/server-core'
|
||||
import notification, {
|
||||
BaseNotificationType,
|
||||
InboxNotification,
|
||||
MentionInboxNotification,
|
||||
NotificationType
|
||||
} from '@hcengineering/notification'
|
||||
import telegram, { TelegramMessage, TelegramNotificationRequest } from '@hcengineering/telegram'
|
||||
import { BaseNotificationType, InboxNotification, NotificationType } from '@hcengineering/notification'
|
||||
import setting, { Integration } from '@hcengineering/setting'
|
||||
import { NotificationProviderFunc, ReceiverInfo, SenderInfo } from '@hcengineering/server-notification'
|
||||
import { getMetadata, getResource, translate } from '@hcengineering/platform'
|
||||
@ -196,7 +201,10 @@ async function getTranslatedData (
|
||||
let { title, body } = await getTranslatedNotificationContent(data, data._class, control)
|
||||
let quote: string | undefined
|
||||
|
||||
if (data.data !== undefined) {
|
||||
if (hierarchy.isDerived(data._class, notification.class.MentionInboxNotification)) {
|
||||
const text = (data as MentionInboxNotification).messageHtml
|
||||
body = text !== undefined ? markupToHTML(text) : body
|
||||
} else if (data.data !== undefined) {
|
||||
body = markupToHTML(data.data)
|
||||
} else if (message !== undefined) {
|
||||
const html = await activityMessageToHtml(control, message)
|
||||
|
Loading…
Reference in New Issue
Block a user