summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-04-04 11:54:52 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-04-04 11:54:52 -0400
commitc7bdce8a6641ed8d361a43b6004a351535c78423 (patch)
treef42d32d8a4d0cd4f702644dcb6a594f905f3f771 /app/notification.go
parent3a79e451ffe3ffe618311ee15b02dbebde6a77b0 (diff)
downloadchat-c7bdce8a6641ed8d361a43b6004a351535c78423.tar.gz
chat-c7bdce8a6641ed8d361a43b6004a351535c78423.tar.bz2
chat-c7bdce8a6641ed8d361a43b6004a351535c78423.zip
PLT-5900 Removed automatic configuration of SiteURL (#5952)
* Revert "PLT-5765 Passed SiteURL to SendNotifications (#5705)" This reverts commit a8e68bd8905972ae59de90fa33d5b3e3c274dc47. * Removed automatic configuration of SiteURL * Reverted unintentional config changes * Updated help text * Added link to docs in Site URL warning * Fixed merge conflict
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/notification.go b/app/notification.go
index 7b61de9ac..ef1b70aad 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -24,7 +24,7 @@ import (
"github.com/nicksnyder/go-i18n/i18n"
)
-func SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, siteURL string) ([]string, *model.AppError) {
+func SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User) ([]string, *model.AppError) {
pchan := Srv.Store.User().GetAllProfilesInChannel(channel.Id, true)
cmnchan := Srv.Store.Channel().GetAllChannelMembersNotifyPropsForChannel(channel.Id, true)
var fchan store.StoreChannel
@@ -171,7 +171,7 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
}
if userAllowsEmails && status.Status != model.STATUS_ONLINE && profileMap[id].DeleteAt == 0 {
- sendNotificationEmail(post, profileMap[id], channel, team, senderName, sender, siteURL)
+ sendNotificationEmail(post, profileMap[id], channel, team, senderName, sender)
}
}
}
@@ -317,7 +317,7 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
return mentionedUsersList, nil
}
-func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Channel, team *model.Team, senderName string, sender *model.User, siteURL string) *model.AppError {
+func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Channel, team *model.Team, senderName string, sender *model.User) *model.AppError {
if channel.IsGroupOrDirect() {
if result := <-Srv.Store.Team().GetTeamsByUserId(user.Id); result.Err != nil {
return result.Err
@@ -367,7 +367,7 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch
var mailTemplate string
var mailParameters map[string]interface{}
- teamURL := siteURL + "/" + team.Name
+ teamURL := utils.GetSiteURL() + "/" + team.Name
tm := time.Unix(post.CreateAt/1000, 0)
userLocale := utils.GetUserTranslations(user.Locale)
@@ -405,7 +405,7 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch
subject := fmt.Sprintf("[%v] %v", utils.Cfg.TeamSettings.SiteName, userLocale(mailTemplate, mailParameters))
bodyPage := utils.NewHTMLTemplate("post_body", user.Locale)
- bodyPage.Props["SiteURL"] = siteURL
+ bodyPage.Props["SiteURL"] = utils.GetSiteURL()
bodyPage.Props["PostMessage"] = GetMessageForNotification(post, userLocale)
if team.Name != "select_team" {
bodyPage.Props["TeamLink"] = teamURL + "/pl/" + post.Id