focalboard/server/services/notify/plugindelivery/message.go
Doug Lauder 75bd409ba0
Notifications phase 1 (#1851)
Backend support for subscribing/unsubscribing to blocks, typically cards and boards. Notifies subscribers when changes are made to cards they are subscribed to.
2021-12-10 10:46:37 -05:00

24 lines
700 B
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package plugindelivery
import (
"fmt"
"github.com/mattermost/focalboard/server/model"
)
const (
// TODO: localize these when i18n is available.
defCommentTemplate = "@%s mentioned you in a comment on the card [%s](%s)\n> %s"
defDescriptionTemplate = "@%s mentioned you in the card [%s](%s)\n> %s"
)
func formatMessage(author string, extract string, card string, link string, block *model.Block) string {
template := defDescriptionTemplate
if block.Type == model.TypeComment {
template = defCommentTemplate
}
return fmt.Sprintf(template, author, card, link, extract)
}