summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-12-10 13:44:11 -0500
committerChristopher Speller <crspeller@gmail.com>2015-12-10 13:44:11 -0500
commit149ac6f3ce52a5ff5d9083191278b1fc140ba8a6 (patch)
treebce32b0142a0b45446a9a2d0c6ff65434644ff11 /api
parentaef16866066c8fec2529e57a9659fd3cb03acc91 (diff)
parentb8efeb2e72475378c7f58e1c8367f8b4da9b7efd (diff)
downloadchat-149ac6f3ce52a5ff5d9083191278b1fc140ba8a6.tar.gz
chat-149ac6f3ce52a5ff5d9083191278b1fc140ba8a6.tar.bz2
chat-149ac6f3ce52a5ff5d9083191278b1fc140ba8a6.zip
Merge pull request #1648 from npcode/notification-email-local-timezone
Use local timezone for notification email
Diffstat (limited to 'api')
-rw-r--r--api/post.go4
-rw-r--r--api/templates/post_body.html2
2 files changed, 3 insertions, 3 deletions
diff --git a/api/post.go b/api/post.go
index 6736d75e2..5fbacc906 100644
--- a/api/post.go
+++ b/api/post.go
@@ -477,8 +477,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team,
teamURL := c.GetSiteURL() + "/" + team.Name
// Build and send the emails
- location, _ := time.LoadLocation("UTC")
- tm := time.Unix(post.CreateAt/1000, 0).In(location)
+ tm := time.Unix(post.CreateAt/1000, 0)
subjectPage := NewServerTemplatePage("post_subject")
subjectPage.Props["SiteURL"] = c.GetSiteURL()
@@ -510,6 +509,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team,
bodyPage.Props["Minute"] = fmt.Sprintf("%02d", tm.Minute())
bodyPage.Props["Month"] = tm.Month().String()[:3]
bodyPage.Props["Day"] = fmt.Sprintf("%d", tm.Day())
+ bodyPage.Props["TimeZone"], _ = tm.Zone()
bodyPage.Props["PostMessage"] = model.ClearMentionTags(post.Message)
bodyPage.Props["TeamLink"] = teamURL + "/channels/" + channel.Name
diff --git a/api/templates/post_body.html b/api/templates/post_body.html
index 182134b1a..00d4a563d 100644
--- a/api/templates/post_body.html
+++ b/api/templates/post_body.html
@@ -18,7 +18,7 @@
<tr>
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
<h2 style="font-weight: normal; margin-top: 10px;">You were mentioned</h2>
- <p>CHANNEL: {{.Props.ChannelName}}<br>{{.Props.SenderName}} - {{.Props.Hour}}:{{.Props.Minute}} GMT, {{.Props.Month}} {{.Props.Day}}<br><pre style="text-align:left;font-family: 'Lato', sans-serif; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">{{.Props.PostMessage}}</pre></p>
+ <p>CHANNEL: {{.Props.ChannelName}}<br>{{.Props.SenderName}} - {{.Props.Hour}}:{{.Props.Minute}} {{.Props.TimeZone}}, {{.Props.Month}} {{.Props.Day}}<br><pre style="text-align:left;font-family: 'Lato', sans-serif; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">{{.Props.PostMessage}}</pre></p>
<p style="margin: 20px 0 15px">
<a href="{{.Props.TeamLink}}" style="background: #2389D7; display: inline-block; border-radius: 3px; color: #fff; border: none; outline: none; min-width: 170px; padding: 15px 25px; font-size: 14px; font-family: inherit; cursor: pointer; -webkit-appearance: none;text-decoration: none;">Go To Channel</a>
</p>