in notification-lark/notification.go [101:127]
func renderNotification(msg plugin.NotificationMessage) string {
lang := i18n.Language(msg.ReceiverLang)
switch msg.Type {
case plugin.NotificationUpdateQuestion:
return plugin.TranslateWithData(lang, lark_i18n.TplUpdateQuestion, msg)
case plugin.NotificationAnswerTheQuestion:
return plugin.TranslateWithData(lang, lark_i18n.TplAnswerTheQuestion, msg)
case plugin.NotificationUpdateAnswer:
return plugin.TranslateWithData(lang, lark_i18n.TplUpdateAnswer, msg)
case plugin.NotificationAcceptAnswer:
return plugin.TranslateWithData(lang, lark_i18n.TplAcceptAnswer, msg)
case plugin.NotificationCommentQuestion:
return plugin.TranslateWithData(lang, lark_i18n.TplCommentQuestion, msg)
case plugin.NotificationCommentAnswer:
return plugin.TranslateWithData(lang, lark_i18n.TplCommentAnswer, msg)
case plugin.NotificationReplyToYou:
return plugin.TranslateWithData(lang, lark_i18n.TplReplyToYou, msg)
case plugin.NotificationMentionYou:
return plugin.TranslateWithData(lang, lark_i18n.TplMentionYou, msg)
case plugin.NotificationInvitedYouToAnswer:
return plugin.TranslateWithData(lang, lark_i18n.TplInvitedYouToAnswer, msg)
case plugin.NotificationNewQuestion, plugin.NotificationNewQuestionFollowedTag:
msg.QuestionTags = renderTag(strings.Split(msg.QuestionTags, ","))
return plugin.TranslateWithData(lang, lark_i18n.TplNewQuestion, msg)
}
return ""
}