mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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
This commit is contained in:
committed by
Joram Wilander
parent
7ac35548c8
commit
fdbfb9a4ed
@@ -351,6 +351,8 @@ func (a *App) sendNotificationEmail(post *model.Post, user *model.User, channel
|
||||
var subjectText string
|
||||
if channel.Type == model.CHANNEL_DIRECT {
|
||||
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 {
|
||||
subjectText = getNotificationEmailSubject(post, translateFunc, a.Config().TeamSettings.SiteName, team.DisplayName)
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
"EnableSignInWithEmail": true,
|
||||
"EnableSignInWithUsername": true,
|
||||
"SendEmailNotifications": true,
|
||||
"UseChannelInEmailNotifications": false,
|
||||
"RequireEmailVerification": false,
|
||||
"FeedbackName": "",
|
||||
"FeedbackEmail": "test@example.com",
|
||||
|
||||
@@ -653,6 +653,7 @@ type EmailSettings struct {
|
||||
EnableSignInWithEmail *bool
|
||||
EnableSignInWithUsername *bool
|
||||
SendEmailNotifications bool
|
||||
UseChannelInEmailNotifications *bool
|
||||
RequireEmailVerification bool
|
||||
FeedbackName string
|
||||
FeedbackEmail string
|
||||
@@ -687,6 +688,10 @@ func (s *EmailSettings) SetDefaults() {
|
||||
s.EnableSignInWithUsername = NewBool(false)
|
||||
}
|
||||
|
||||
if s.UseChannelInEmailNotifications == nil {
|
||||
s.UseChannelInEmailNotifications = NewBool(false)
|
||||
}
|
||||
|
||||
if s.SendPushNotifications == nil {
|
||||
s.SendPushNotifications = NewBool(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user