summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/notification.go9
-rw-r--r--i18n/en.json8
-rw-r--r--model/config.go5
-rw-r--r--webapp/components/admin_console/push_settings.jsx6
-rwxr-xr-xwebapp/i18n/en.json5
5 files changed, 26 insertions, 7 deletions
diff --git a/app/notification.go b/app/notification.go
index d145b21b3..d4af6463b 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -501,6 +501,15 @@ func sendPushNotification(post *model.Post, user *model.User, channel *model.Cha
} else {
msg.Message = senderName + userLocale("api.post.send_notifications_and_forget.push_in") + channelName + ": " + model.ClearMentionTags(post.Message)
}
+ } else if *utils.Cfg.EmailSettings.PushNotificationContents == model.GENERIC_NO_CHANNEL_NOTIFICATION {
+ if channel.Type == model.CHANNEL_DIRECT {
+ msg.Category = model.CATEGORY_DM
+ msg.Message = senderName + userLocale("api.post.send_notifications_and_forget.push_message")
+ } else if wasMentioned || channel.Type == model.CHANNEL_GROUP {
+ msg.Message = senderName + userLocale("api.post.send_notifications_and_forget.push_mention_no_channel")
+ } else {
+ msg.Message = senderName + userLocale("api.post.send_notifications_and_forget.push_non_mention_no_channel")
+ }
} else {
if channel.Type == model.CHANNEL_DIRECT {
msg.Category = model.CATEGORY_DM
diff --git a/i18n/en.json b/i18n/en.json
index 3287af260..2d4581ad8 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1812,6 +1812,10 @@
"translation": " mentioned you in "
},
{
+ "id": "api.post.send_notifications_and_forget.push_mention_no_channel",
+ "translation": " mentioned you"
+ },
+ {
"id": "api.post.send_notifications_and_forget.push_message",
"translation": " sent you a direct message"
},
@@ -1820,6 +1824,10 @@
"translation": " posted in "
},
{
+ "id": "api.post.send_notifications_and_forget.push_non_mention_no_channel",
+ "translation": " posted a message"
+ },
+ {
"id": "api.post.send_notifications_and_forget.push_notification.error",
"translation": "Failed to send push device_id={{.DeviceId}}, err={{.Error}}"
},
diff --git a/model/config.go b/model/config.go
index 0bcc092f7..c13540580 100644
--- a/model/config.go
+++ b/model/config.go
@@ -33,8 +33,9 @@ const (
WEBSERVER_MODE_GZIP = "gzip"
WEBSERVER_MODE_DISABLED = "disabled"
- GENERIC_NOTIFICATION = "generic"
- FULL_NOTIFICATION = "full"
+ GENERIC_NO_CHANNEL_NOTIFICATION = "generic_no_channel"
+ GENERIC_NOTIFICATION = "generic"
+ FULL_NOTIFICATION = "full"
DIRECT_MESSAGE_ANY = "any"
DIRECT_MESSAGE_TEAM = "team"
diff --git a/webapp/components/admin_console/push_settings.jsx b/webapp/components/admin_console/push_settings.jsx
index c5aebf69e..b5f788c86 100644
--- a/webapp/components/admin_console/push_settings.jsx
+++ b/webapp/components/admin_console/push_settings.jsx
@@ -207,7 +207,8 @@ export default class PushSettings extends AdminSettings {
<DropdownSetting
id='pushNotificationContents'
values={[
- {value: 'generic', text: Utils.localizeMessage('admin.email.genericPushNotification', 'Send generic description with user and channel names')},
+ {value: 'generic_no_channel', text: Utils.localizeMessage('admin.email.genericNoChannelPushNotification', '"Send generic description with only sender name')},
+ {value: 'generic', text: Utils.localizeMessage('admin.email.genericPushNotification', 'Send generic description with sender and channel names')},
{value: 'full', text: Utils.localizeMessage('admin.email.fullPushNotification', 'Send full message snippet')}
]}
label={
@@ -222,8 +223,7 @@ export default class PushSettings extends AdminSettings {
helpText={
<FormattedHTMLMessage
id='admin.email.pushContentDesc'
- defaultMessage='Selecting "Send generic description with user and channel names" provides push notifications with generic messages, including names of users and channels but no specific details from the message text.<br /><br />
- Selecting "Send full message snippet" sends excerpts from messages triggering notifications with specifics and may include confidential information sent in messages. If your Push Notification Service is outside your firewall, it is HIGHLY RECOMMENDED this option only be used with an "https" protocol to encrypt the connection.'
+ defaultMessage='"Send generic description with only sender name" includes only the name of the person who sent the message in push notifications, with no information about channel name or message contents.<br /><br />"Send generic description with sender and channel names" includes the name of the person who sent the message and the channel it was sent in, but not the message text.<br /><br />"Send full message snippet" includes a message excerpt in push notifications, which may contain confidential information sent in messages. If your Push Notification Service is outside your firewall, it is *highly recommended* this option only be used with an "https" protocol to encrypt the connection.'
/>
}
/>
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index 992af160f..a761793be 100755
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -297,7 +297,8 @@
"admin.email.enableEmailBatchingDesc": "When true, users will have email notifications for multiple direct messages and mentions combined into a single email. Batching will occur at a default interval of 15 minutes, configurable in Account Settings > Notifications.",
"admin.email.enableEmailBatchingTitle": "Enable Email Batching:",
"admin.email.fullPushNotification": "Send full message snippet",
- "admin.email.genericPushNotification": "Send generic description with user and channel names",
+ "admin.email.genericNoChannelPushNotification": "Send generic description with only sender name",
+ "admin.email.genericPushNotification": "Send generic description with sender and channel names",
"admin.email.inviteSaltDescription": "32-character salt added to signing of email invites. Randomly generated on install. Click \"Regenerate\" to create new salt.",
"admin.email.inviteSaltExample": "E.g.: \"bjlSR4QqkXFBr7TP4oDzlfZmcNuH9Yo\"",
"admin.email.inviteSaltTitle": "Email Invite Salt:",
@@ -320,7 +321,7 @@
"admin.email.passwordSaltDescription": "32-character salt added to signing of password reset emails. Randomly generated on install. Click \"Regenerate\" to create new salt.",
"admin.email.passwordSaltExample": "E.g.: \"bjlSR4QqkXFBr7TP4oDzlfZmcNuH9Yo\"",
"admin.email.passwordSaltTitle": "Password Reset Salt:",
- "admin.email.pushContentDesc": "Selecting \"Send generic description with user and channel names\" provides push notifications with generic messages, including names of users and channels but no specific details from the message text.<br /><br />Selecting \"Send full message snippet\" sends excerpts from messages triggering notifications with specifics and may include confidential information sent in messages. If your Push Notification Service is outside your firewall, it is HIGHLY RECOMMENDED this option only be used with an \"https\" protocol to encrypt the connection.",
+ "admin.email.pushContentDesc": "\"Send generic description with only sender name\" includes only the name of the person who sent the message in push notifications, with no information about channel name or message contents.<br /><br />\"Send generic description with sender and channel names\" includes the name of the person who sent the message and the channel it was sent in, but not the message text.<br /><br />\"Send full message snippet\" includes a message excerpt in push notifications, which may contain confidential information sent in messages. If your Push Notification Service is outside your firewall, it is *highly recommended* this option only be used with an \"https\" protocol to encrypt the connection.",
"admin.email.pushContentTitle": "Push Notification Contents:",
"admin.email.pushDesc": "Typically set to true in production. When true, Mattermost attempts to send iOS and Android push notifications through the push notification server.",
"admin.email.pushOff": "Do not send push notifications",