Update email templates for guest accounts (#11802)

Этот коммит содержится в:
Jesús Espino
2019-08-06 12:07:35 +02:00
коммит произвёл GitHub
родитель 4acb139870
Коммит c3c2b6dec1
3 изменённых файлов: 19 добавлений и 13 удалений

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

@@ -317,8 +317,6 @@ func (a *App) SendInviteEmails(team *model.Team, senderName string, senderUserId
for _, invite := range invites {
if len(invite) > 0 {
senderRole := utils.T("api.team.invite_members.member")
subject := utils.T("api.templates.invite_subject",
map[string]interface{}{"SenderName": senderName,
"TeamDisplayName": team.DisplayName,
@@ -328,7 +326,7 @@ func (a *App) SendInviteEmails(team *model.Team, senderName string, senderUserId
bodyPage.Props["SiteURL"] = siteURL
bodyPage.Props["Title"] = utils.T("api.templates.invite_body.title")
bodyPage.Html["Info"] = utils.TranslateAsHtml(utils.T, "api.templates.invite_body.info",
map[string]interface{}{"SenderStatus": senderRole, "SenderName": senderName, "TeamDisplayName": team.DisplayName})
map[string]interface{}{"SenderName": senderName, "TeamDisplayName": team.DisplayName})
bodyPage.Props["Button"] = utils.T("api.templates.invite_body.button")
bodyPage.Html["ExtraInfo"] = utils.TranslateAsHtml(utils.T, "api.templates.invite_body.extra_info",
map[string]interface{}{"TeamDisplayName": team.DisplayName})
@@ -380,8 +378,6 @@ func (a *App) SendGuestInviteEmails(team *model.Team, channels []*model.Channel,
for _, invite := range invites {
if len(invite) > 0 {
senderRole := utils.T("api.team.invite_members.member")
subject := utils.T("api.templates.invite_guest_subject",
map[string]interface{}{"SenderName": senderName,
"TeamDisplayName": team.DisplayName,
@@ -391,8 +387,10 @@ func (a *App) SendGuestInviteEmails(team *model.Team, channels []*model.Channel,
bodyPage.Props["SiteURL"] = siteURL
bodyPage.Props["Title"] = utils.T("api.templates.invite_body.title")
bodyPage.Html["Info"] = utils.TranslateAsHtml(utils.T, "api.templates.invite_body_guest.info",
map[string]interface{}{"SenderStatus": senderRole, "SenderName": senderName, "TeamDisplayName": team.DisplayName})
map[string]interface{}{"SenderName": senderName, "TeamDisplayName": team.DisplayName})
bodyPage.Props["Button"] = utils.T("api.templates.invite_body.button")
bodyPage.Props["SenderName"] = senderName
bodyPage.Props["SenderId"] = senderUserId
bodyPage.Props["Message"] = ""
if message != "" {
bodyPage.Props["Message"] = message

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

@@ -1934,10 +1934,6 @@
"id": "api.team.invite_members.invalid_email.app_error",
"translation": "The following email addresses do not belong to an accepted domain: {{.Addresses}}. Please contact your System Administrator for details."
},
{
"id": "api.team.invite_members.member",
"translation": "member"
},
{
"id": "api.team.invite_members.no_one.app_error",
"translation": "No one to invite."
@@ -2140,7 +2136,7 @@
},
{
"id": "api.templates.invite_body.info",
"translation": "The team {{.SenderStatus}} [[{{.SenderName}}]], has invited you to join [[{{.TeamDisplayName}}]]."
"translation": "[[{{.SenderName}}]], has invited you to join [[{{.TeamDisplayName}}]]."
},
{
"id": "api.templates.invite_body.title",
@@ -2148,7 +2144,7 @@
},
{
"id": "api.templates.invite_body_guest.info",
"translation": "The team {{.SenderStatus}} [[{{.SenderName}}]], has invited you to join team [[{{.TeamDisplayName}}]] as a guest."
"translation": "[[{{.SenderName}}]], has invited you to join team [[{{.TeamDisplayName}}]] as a guest."
},
{
"id": "api.templates.invite_guest_subject",

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

@@ -22,7 +22,19 @@
<p style="margin: 30px 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;">{{.Props.Button}}</a>
</p>
<p>{{.Props.Message}}</p>
{{if .Props.Message}}
<table border="0" cellpadding="0" cellspacing="0" style="padding: 20px; margin: 35px auto 0 auto; border-radius: 5px; background: #f2f2f2; min-width: 550px">
<tr>
<td style="border: 0; padding: 0; width: 36px; vertical-align: top">
<img src="{{.Props.SiteURL}}/api/v4/users/{{.Props.SenderId}}/image" style="height: 36px; width=36px; border-radius: 18px;">
</td>
<td style="border: 0; padding: 0 0 0 20px;">
<p style="font-weight: bold; margin-top: 0;">{{.Props.SenderName}}</p>
<p>{{.Props.Message}}</p>
</td>
</tr>
</table>
{{end}}
<br/>
<p>{{.Html.ExtraInfo}}<br/><br/><a href='{{.Props.TeamURL}}'>{{.Props.TeamURL}}</a></p>
</td>