Merge pull request #305 from nickago/MM-1681
MM-1681 Fixed regression of static images not displaying in emails
Этот коммит содержится в:
@@ -16,10 +16,10 @@ var ServerTemplates *template.Template
|
|||||||
|
|
||||||
type ServerTemplatePage Page
|
type ServerTemplatePage Page
|
||||||
|
|
||||||
func NewServerTemplatePage(templateName, teamURL string) *ServerTemplatePage {
|
func NewServerTemplatePage(templateName, siteURL string) *ServerTemplatePage {
|
||||||
props := make(map[string]string)
|
props := make(map[string]string)
|
||||||
props["AnalyticsUrl"] = utils.Cfg.ServiceSettings.AnalyticsUrl
|
props["AnalyticsUrl"] = utils.Cfg.ServiceSettings.AnalyticsUrl
|
||||||
return &ServerTemplatePage{TemplateName: templateName, SiteName: utils.Cfg.ServiceSettings.SiteName, FeedbackEmail: utils.Cfg.EmailSettings.FeedbackEmail, TeamURL: teamURL, Props: props}
|
return &ServerTemplatePage{TemplateName: templateName, SiteName: utils.Cfg.ServiceSettings.SiteName, FeedbackEmail: utils.Cfg.EmailSettings.FeedbackEmail, SiteURL: siteURL, Props: props}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me *ServerTemplatePage) Render() string {
|
func (me *ServerTemplatePage) Render() string {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ type Page struct {
|
|||||||
Title string
|
Title string
|
||||||
SiteName string
|
SiteName string
|
||||||
FeedbackEmail string
|
FeedbackEmail string
|
||||||
TeamURL string
|
SiteURL string
|
||||||
Props map[string]string
|
Props map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, siteURL string) {
|
|||||||
location, _ := time.LoadLocation("UTC")
|
location, _ := time.LoadLocation("UTC")
|
||||||
tm := time.Unix(post.CreateAt/1000, 0).In(location)
|
tm := time.Unix(post.CreateAt/1000, 0).In(location)
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("post_subject", teamURL)
|
subjectPage := NewServerTemplatePage("post_subject", siteURL)
|
||||||
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
subjectPage.Props["SubjectText"] = subjectText
|
subjectPage.Props["SubjectText"] = subjectText
|
||||||
subjectPage.Props["Month"] = tm.Month().String()[:3]
|
subjectPage.Props["Month"] = tm.Month().String()[:3]
|
||||||
@@ -395,7 +395,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, siteURL string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
bodyPage := NewServerTemplatePage("post_body", teamURL)
|
bodyPage := NewServerTemplatePage("post_body", siteURL)
|
||||||
bodyPage.Props["Nickname"] = profileMap[id].FirstName
|
bodyPage.Props["Nickname"] = profileMap[id].FirstName
|
||||||
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage.Props["ChannelName"] = channelName
|
bodyPage.Props["ChannelName"] = channelName
|
||||||
|
|||||||
@@ -344,8 +344,6 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
func InviteMembers(c *Context, team *model.Team, user *model.User, invites []string) {
|
func InviteMembers(c *Context, team *model.Team, user *model.User, invites []string) {
|
||||||
for _, invite := range invites {
|
for _, invite := range invites {
|
||||||
if len(invite) > 0 {
|
if len(invite) > 0 {
|
||||||
teamURL := ""
|
|
||||||
teamURL = c.GetTeamURLFromTeam(team)
|
|
||||||
|
|
||||||
sender := user.GetDisplayName()
|
sender := user.GetDisplayName()
|
||||||
|
|
||||||
@@ -356,10 +354,10 @@ func InviteMembers(c *Context, team *model.Team, user *model.User, invites []str
|
|||||||
senderRole = "member"
|
senderRole = "member"
|
||||||
}
|
}
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("invite_subject", teamURL)
|
subjectPage := NewServerTemplatePage("invite_subject", c.GetSiteURL())
|
||||||
subjectPage.Props["SenderName"] = sender
|
subjectPage.Props["SenderName"] = sender
|
||||||
subjectPage.Props["TeamDisplayName"] = team.DisplayName
|
subjectPage.Props["TeamDisplayName"] = team.DisplayName
|
||||||
bodyPage := NewServerTemplatePage("invite_body", teamURL)
|
bodyPage := NewServerTemplatePage("invite_body", c.GetSiteURL())
|
||||||
bodyPage.Props["TeamDisplayName"] = team.DisplayName
|
bodyPage.Props["TeamDisplayName"] = team.DisplayName
|
||||||
bodyPage.Props["SenderName"] = sender
|
bodyPage.Props["SenderName"] = sender
|
||||||
bodyPage.Props["SenderStatus"] = senderRole
|
bodyPage.Props["SenderStatus"] = senderRole
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
||||||
<h2 style="font-weight: normal; margin-top: 10px;">You updated your email</h2>
|
<h2 style="font-weight: normal; margin-top: 10px;">You updated your email</h2>
|
||||||
<p>You updated your email for {{.Props.TeamDisplayName}} on {{ .TeamURL }}<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
|
<p>You updated your email for {{.Props.TeamDisplayName}} on {{ .Props.TeamURL }}<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
||||||
<h2 style="font-weight: normal; margin-top: 10px;">You updated your password</h2>
|
<h2 style="font-weight: normal; margin-top: 10px;">You updated your password</h2>
|
||||||
<p>You updated your password for {{.Props.TeamDisplayName}} on {{ .TeamURL }} by {{.Props.Method}}.<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
|
<p>You updated your password for {{.Props.TeamDisplayName}} on {{ .Props.TeamURL }} by {{.Props.Method}}.<br> If this change wasn't initiated by you, please reply to this email and let us know.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 20px 20px 10px; text-align:left;">
|
<td style="padding: 20px 20px 10px; text-align:left;">
|
||||||
<img src="{{.TeamURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
<img src="{{.SiteURL}}/static/images/{{.SiteName}}-logodark.png" width="130px" style="opacity: 0.5" alt="">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
<td style="border-bottom: 1px solid #ddd; padding: 0 0 20px;">
|
||||||
<h2 style="font-weight: normal; margin-top: 10px;">You joined the {{.Props.TeamDisplayName}} team at {{.SiteName}}!</h2>
|
<h2 style="font-weight: normal; margin-top: 10px;">You joined the {{.Props.TeamDisplayName}} team at {{.SiteName}}!</h2>
|
||||||
<p>Please let me know if you have any questions.<br>Enjoy your stay at <a href="{{.TeamURL}}">{{.SiteName}}</a>.</p>
|
<p>Please let me know if you have any questions.<br>Enjoy your stay at <a href="{{.Props.TeamURL}}">{{.SiteName}}</a>.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
<td style="text-align: center;color: #AAA; font-size: 11px; padding-bottom: 10px;">
|
||||||
<p style="margin: 25px 0;">
|
<p style="margin: 25px 0;">
|
||||||
<img width="65" src="{{.TeamURL}}/static/images/circles.png" alt="">
|
<img width="65" src="{{.SiteURL}}/static/images/circles.png" alt="">
|
||||||
</p>
|
</p>
|
||||||
<p style="padding: 0 50px;">
|
<p style="padding: 0 50px;">
|
||||||
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
(c) 2015 SpinPunch, Inc. 855 El Camino Real, 13A-168, Palo Alto, CA, 94301.<br>
|
||||||
|
|||||||
35
api/user.go
35
api/user.go
@@ -209,14 +209,15 @@ func CreateUser(c *Context, team *model.Team, user *model.User) *model.User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func fireAndForgetWelcomeEmail(name, email, teamDisplayName, link string) {
|
func fireAndForgetWelcomeEmail(name, email, teamDisplayName, link, siteURL string) {
|
||||||
go func() {
|
go func() {
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("welcome_subject", link)
|
subjectPage := NewServerTemplatePage("welcome_subject", siteURL)
|
||||||
bodyPage := NewServerTemplatePage("welcome_body", link)
|
bodyPage := NewServerTemplatePage("welcome_body", siteURL)
|
||||||
bodyPage.Props["Nickname"] = name
|
bodyPage.Props["Nickname"] = name
|
||||||
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage.Props["FeedbackName"] = utils.Cfg.EmailSettings.FeedbackName
|
bodyPage.Props["FeedbackName"] = utils.Cfg.EmailSettings.FeedbackName
|
||||||
|
bodyPage.Props["TeamURL"] = link
|
||||||
|
|
||||||
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
||||||
l4g.Error("Failed to send welcome email successfully err=%v", err)
|
l4g.Error("Failed to send welcome email successfully err=%v", err)
|
||||||
@@ -230,9 +231,9 @@ func FireAndForgetVerifyEmail(userId, userEmail, teamName, teamDisplayName, site
|
|||||||
|
|
||||||
link := fmt.Sprintf("%s/verify_email?uid=%s&hid=%s&teamname=%s&email=%s", siteURL, userId, model.HashPassword(userId), teamName, userEmail)
|
link := fmt.Sprintf("%s/verify_email?uid=%s&hid=%s&teamname=%s&email=%s", siteURL, userId, model.HashPassword(userId), teamName, userEmail)
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("verify_subject", teamURL)
|
subjectPage := NewServerTemplatePage("verify_subject", siteURL)
|
||||||
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage := NewServerTemplatePage("verify_body", teamURL)
|
bodyPage := NewServerTemplatePage("verify_body", siteURL)
|
||||||
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage.Props["VerifyUrl"] = link
|
bodyPage.Props["VerifyUrl"] = link
|
||||||
|
|
||||||
@@ -800,7 +801,7 @@ func updateUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
l4g.Error(tresult.Err.Message)
|
l4g.Error(tresult.Err.Message)
|
||||||
} else {
|
} else {
|
||||||
team := tresult.Data.(*model.Team)
|
team := tresult.Data.(*model.Team)
|
||||||
fireAndForgetEmailChangeEmail(rusers[1].Email, team.DisplayName, c.GetTeamURLFromTeam(team))
|
fireAndForgetEmailChangeEmail(rusers[1].Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -879,7 +880,7 @@ func updatePassword(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
l4g.Error(tresult.Err.Message)
|
l4g.Error(tresult.Err.Message)
|
||||||
} else {
|
} else {
|
||||||
team := tresult.Data.(*model.Team)
|
team := tresult.Data.(*model.Team)
|
||||||
fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), "using the settings menu")
|
fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL(), "using the settings menu")
|
||||||
}
|
}
|
||||||
|
|
||||||
data := make(map[string]string)
|
data := make(map[string]string)
|
||||||
@@ -1069,8 +1070,8 @@ func sendPasswordReset(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
link := fmt.Sprintf("%s/reset_password?d=%s&h=%s", c.GetTeamURLFromTeam(team), url.QueryEscape(data), url.QueryEscape(hash))
|
link := fmt.Sprintf("%s/reset_password?d=%s&h=%s", c.GetTeamURLFromTeam(team), url.QueryEscape(data), url.QueryEscape(hash))
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("reset_subject", c.GetTeamURLFromTeam(team))
|
subjectPage := NewServerTemplatePage("reset_subject", c.GetSiteURL())
|
||||||
bodyPage := NewServerTemplatePage("reset_body", c.GetTeamURLFromTeam(team))
|
bodyPage := NewServerTemplatePage("reset_body", c.GetSiteURL())
|
||||||
bodyPage.Props["ResetUrl"] = link
|
bodyPage.Props["ResetUrl"] = link
|
||||||
|
|
||||||
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
||||||
@@ -1160,19 +1161,20 @@ func resetPassword(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
c.LogAuditWithUserId(userId, "success")
|
c.LogAuditWithUserId(userId, "success")
|
||||||
}
|
}
|
||||||
|
|
||||||
fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), "using a reset password link")
|
fireAndForgetPasswordChangeEmail(user.Email, team.DisplayName, c.GetTeamURLFromTeam(team), c.GetSiteURL(), "using a reset password link")
|
||||||
|
|
||||||
props["new_password"] = ""
|
props["new_password"] = ""
|
||||||
w.Write([]byte(model.MapToJson(props)))
|
w.Write([]byte(model.MapToJson(props)))
|
||||||
}
|
}
|
||||||
|
|
||||||
func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, method string) {
|
func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, siteURL, method string) {
|
||||||
go func() {
|
go func() {
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("password_change_subject", teamURL)
|
subjectPage := NewServerTemplatePage("password_change_subject", siteURL)
|
||||||
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage := NewServerTemplatePage("password_change_body", teamURL)
|
bodyPage := NewServerTemplatePage("password_change_body", siteURL)
|
||||||
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
|
bodyPage.Props["TeamURL"] = teamURL
|
||||||
bodyPage.Props["Method"] = method
|
bodyPage.Props["Method"] = method
|
||||||
|
|
||||||
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
||||||
@@ -1182,13 +1184,14 @@ func fireAndForgetPasswordChangeEmail(email, teamDisplayName, teamURL, method st
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func fireAndForgetEmailChangeEmail(email, teamDisplayName, teamURL string) {
|
func fireAndForgetEmailChangeEmail(email, teamDisplayName, teamURL, siteURL string) {
|
||||||
go func() {
|
go func() {
|
||||||
|
|
||||||
subjectPage := NewServerTemplatePage("email_change_subject", teamURL)
|
subjectPage := NewServerTemplatePage("email_change_subject", siteURL)
|
||||||
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
subjectPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
bodyPage := NewServerTemplatePage("email_change_body", teamURL)
|
bodyPage := NewServerTemplatePage("email_change_body", siteURL)
|
||||||
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
bodyPage.Props["TeamDisplayName"] = teamDisplayName
|
||||||
|
bodyPage.Props["TeamURL"] = teamURL
|
||||||
|
|
||||||
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
if err := utils.SendMail(email, subjectPage.Render(), bodyPage.Render()); err != nil {
|
||||||
l4g.Error("Failed to send update password email successfully err=%v", err)
|
l4g.Error("Failed to send update password email successfully err=%v", err)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user