Этот коммит содержится в:
Asaad Mahmood
2015-06-30 01:07:00 +05:00
родитель fce4ad42cb e6b5bdef82
Коммит 7f8c2a9c83
3 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@@ -488,12 +488,21 @@ func InviteMembers(team *model.Team, user *model.User, invites []string) {
} else { } else {
sender = user.FullName sender = user.FullName
} }
senderRole := ""
if strings.Contains(user.Roles, model.ROLE_ADMIN) || strings.Contains(user.Roles, model.ROLE_SYSTEM_ADMIN) {
senderRole = "administrator"
} else {
senderRole = "member"
}
subjectPage := NewServerTemplatePage("invite_subject", teamUrl) subjectPage := NewServerTemplatePage("invite_subject", teamUrl)
subjectPage.Props["SenderName"] = sender subjectPage.Props["SenderName"] = sender
subjectPage.Props["TeamName"] = team.Name subjectPage.Props["TeamName"] = team.Name
bodyPage := NewServerTemplatePage("invite_body", teamUrl) bodyPage := NewServerTemplatePage("invite_body", teamUrl)
bodyPage.Props["TeamName"] = team.Name bodyPage.Props["TeamName"] = team.Name
bodyPage.Props["SenderName"] = sender bodyPage.Props["SenderName"] = sender
bodyPage.Props["SenderStatus"] = senderRole
bodyPage.Props["Email"] = invite bodyPage.Props["Email"] = invite

Просмотреть файл

@@ -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've been invited</h2> <h2 style="font-weight: normal; margin-top: 10px;">You've been invited</h2>
<p>{{.Props.TeamName}} started using {{.SiteName}}.<br> The team administrator <strong>{{.Props.SenderName}}</strong>, has invited you to join <strong>{{.Props.TeamName}}</strong>.</p> <p>{{.Props.TeamName}} started using {{.SiteName}}.<br> The team {{.Props.SenderStatus}} <strong>{{.Props.SenderName}}</strong>, has invited you to join <strong>{{.Props.TeamName}}</strong>.</p>
<p style="margin: 20px 0 15px"> <p style="margin: 20px 0 15px">
<a href="{{.Props.Link}}" style="background: #2389D7; border-radius: 3px; color: #fff; border: none; outline: none; min-width: 200px; padding: 15px 25px; font-size: 14px; font-family: inherit; cursor: pointer; -webkit-appearance: none;text-decoration: none;">Join Team</a> <a href="{{.Props.Link}}" style="background: #2389D7; border-radius: 3px; color: #fff; border: none; outline: none; min-width: 200px; padding: 15px 25px; font-size: 14px; font-family: inherit; cursor: pointer; -webkit-appearance: none;text-decoration: none;">Join Team</a>
</p> </p>

Просмотреть файл

@@ -11,6 +11,7 @@ import (
"net" "net"
"net/mail" "net/mail"
"net/smtp" "net/smtp"
"html"
) )
func CheckMailSettings() *model.AppError { func CheckMailSettings() *model.AppError {
@@ -84,7 +85,7 @@ func SendMail(to, subject, body string) *model.AppError {
headers := make(map[string]string) headers := make(map[string]string)
headers["From"] = fromMail.String() headers["From"] = fromMail.String()
headers["To"] = toMail.String() headers["To"] = toMail.String()
headers["Subject"] = subject headers["Subject"] = html.UnescapeString(subject)
headers["MIME-version"] = "1.0" headers["MIME-version"] = "1.0"
headers["Content-Type"] = "text/html" headers["Content-Type"] = "text/html"