[MM-37727] - Self-managed: Update email template to new branding - Mention (#18134)
* [MM-37727] - Self-managed: Update email template to new branding - Mention * fix lint * truncate long channel names * change rgba to rgb * feedback impl * adjust character truncation length Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
098099aedd
Коммит
2547e47eab
@@ -172,6 +172,18 @@ func getGroupMessageNotificationEmailSubject(user *model.User, post *model.Post,
|
||||
return translateFunc("app.notification.subject.group_message.generic", subjectParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* If the name is longer than i characters, replace remaining characters with ...
|
||||
*/
|
||||
func truncateUserNames(name string, i int) string {
|
||||
runes := []rune(name)
|
||||
if len(runes) > i {
|
||||
newString := string(runes[:i])
|
||||
return newString + "..."
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
type postData struct {
|
||||
SenderName string
|
||||
ChannelName string
|
||||
@@ -187,7 +199,7 @@ type postData struct {
|
||||
*/
|
||||
func (a *App) getNotificationEmailBody(recipient *model.User, post *model.Post, channel *model.Channel, channelName string, senderName string, teamName string, landingURL string, emailNotificationContentsType string, useMilitaryTime bool, translateFunc i18n.TranslateFunc, senderPhoto string) (string, error) {
|
||||
pData := postData{
|
||||
SenderName: senderName,
|
||||
SenderName: truncateUserNames(senderName, 22),
|
||||
SenderPhoto: senderPhoto,
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user