Replace Channel Name for Team in Email Notifications (#7839)

* allow option to set channel name in email notification subject

* Added TeamName to title when UseChannelInEmailNotifications=true
Этот коммит содержится в:
Chris Duarte
2017-11-24 09:57:02 -08:00
коммит произвёл Joram Wilander
родитель 7ac35548c8
Коммит fdbfb9a4ed
3 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@@ -351,6 +351,8 @@ func (a *App) sendNotificationEmail(post *model.Post, user *model.User, channel
var subjectText string var subjectText string
if channel.Type == model.CHANNEL_DIRECT { if channel.Type == model.CHANNEL_DIRECT {
subjectText = getDirectMessageNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, senderName) subjectText = getDirectMessageNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, senderName)
} else if *a.Config().EmailSettings.UseChannelInEmailNotifications {
subjectText = getNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, team.DisplayName+" ("+channel.DisplayName+")")
} else { } else {
subjectText = getNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, team.DisplayName) subjectText = getNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, team.DisplayName)
} }

Просмотреть файл

@@ -143,6 +143,7 @@
"EnableSignInWithEmail": true, "EnableSignInWithEmail": true,
"EnableSignInWithUsername": true, "EnableSignInWithUsername": true,
"SendEmailNotifications": true, "SendEmailNotifications": true,
"UseChannelInEmailNotifications": false,
"RequireEmailVerification": false, "RequireEmailVerification": false,
"FeedbackName": "", "FeedbackName": "",
"FeedbackEmail": "test@example.com", "FeedbackEmail": "test@example.com",

Просмотреть файл

@@ -653,6 +653,7 @@ type EmailSettings struct {
EnableSignInWithEmail *bool EnableSignInWithEmail *bool
EnableSignInWithUsername *bool EnableSignInWithUsername *bool
SendEmailNotifications bool SendEmailNotifications bool
UseChannelInEmailNotifications *bool
RequireEmailVerification bool RequireEmailVerification bool
FeedbackName string FeedbackName string
FeedbackEmail string FeedbackEmail string
@@ -687,6 +688,10 @@ func (s *EmailSettings) SetDefaults() {
s.EnableSignInWithUsername = NewBool(false) s.EnableSignInWithUsername = NewBool(false)
} }
if s.UseChannelInEmailNotifications == nil {
s.UseChannelInEmailNotifications = NewBool(false)
}
if s.SendPushNotifications == nil { if s.SendPushNotifications == nil {
s.SendPushNotifications = NewBool(false) s.SendPushNotifications = NewBool(false)
} }