focalboard/server/services/notify/plugindelivery/message.go
Rajat Dabade 853c2950f5
Cherry pick to main for add board link in bot notification (#3272)
Co-authored-by: Varghese Jose <varghese.jose@tutanota.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: jprusch <rs@schaeferbarthold.de>
2022-06-24 12:39:04 +05:30

24 lines
786 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) in board [%s](%s)\n> %s"
defDescriptionTemplate = "@%s mentioned you in the card [%s](%s) in board [%s](%s)\n> %s"
)
func formatMessage(author string, extract string, card string, link string, block *model.Block, boardLink string, board string) string {
template := defDescriptionTemplate
if block.Type == model.TypeComment {
template = defCommentTemplate
}
return fmt.Sprintf(template, author, card, link, board, boardLink, extract)
}