From ab8b8e8bf2fe7e55573a8d74955482cfa396582e Mon Sep 17 00:00:00 2001 From: Allan Guwatudde Date: Thu, 15 Apr 2021 13:23:03 +0300 Subject: [PATCH] [MM-34240] - Cloud: "Congratulations" welcome email missing images (#17350) * [MM-34240]-Cloud: Congratulations welcome email missing images * Use img instead of svg * Add fallback font Arial * Feedback impl * EOF Co-authored-by: Mattermod --- api4/cloud.go | 2 +- app/email.go | 8 +- templates/cloud_welcome_email.html | 304 +++++++++++++++-------------- 3 files changed, 157 insertions(+), 157 deletions(-) diff --git a/api4/cloud.go b/api4/cloud.go index 0eb8f56635..c625779d22 100644 --- a/api4/cloud.go +++ b/api4/cloud.go @@ -408,7 +408,7 @@ func handleCWSWebhook(c *Context, w http.ResponseWriter, r *http.Request) { return } - if appErr := c.App.Srv().EmailService.SendCloudWelcomeEmail(user.Email, user.Locale, team.InviteId, subscription.GetWorkSpaceNameFromDNS(), subscription.DNS); appErr != nil { + if appErr := c.App.Srv().EmailService.SendCloudWelcomeEmail(user.Email, user.Locale, team.InviteId, subscription.GetWorkSpaceNameFromDNS(), subscription.DNS, *c.App.Config().ServiceSettings.SiteURL); appErr != nil { c.Err = appErr return } diff --git a/app/email.go b/app/email.go index 383dc42a06..e34cf9bf47 100644 --- a/app/email.go +++ b/app/email.go @@ -315,23 +315,21 @@ func (es *EmailService) SendCloudTrialEndWarningEmail(userEmail, userName, trial } // SendCloudWelcomeEmail sends the cloud version of the welcome email -func (es *EmailService) SendCloudWelcomeEmail(userEmail, locale, teamInviteID, workSpaceName, dns string) *model.AppError { +func (es *EmailService) SendCloudWelcomeEmail(userEmail, locale, teamInviteID, workSpaceName, dns, siteURL string) *model.AppError { T := i18n.GetUserTranslations(locale) subject := T("api.templates.cloud_welcome_email.subject") - workSpacePath := fmt.Sprintf("https://%s", dns) - data := es.newEmailTemplateData(locale) data.Props["Title"] = T("api.templates.cloud_welcome_email.title", map[string]interface{}{"WorkSpace": workSpaceName}) data.Props["SubTitle"] = T("api.templates.cloud_welcome_email.subtitle") data.Props["SubTitleInfo"] = T("api.templates.cloud_welcome_email.subtitle_info") data.Props["Info"] = T("api.templates.cloud_welcome_email.info") data.Props["Info2"] = T("api.templates.cloud_welcome_email.info2") - data.Props["WorkSpacePath"] = workSpacePath + data.Props["WorkSpacePath"] = siteURL data.Props["DNS"] = dns data.Props["InviteInfo"] = T("api.templates.cloud_welcome_email.invite_info") data.Props["InviteSubInfo"] = T("api.templates.cloud_welcome_email.invite_sub_info", map[string]interface{}{"WorkSpace": workSpaceName}) - data.Props["InviteSubInfoLink"] = fmt.Sprintf("%s/signup_user_complete/?id=%s", workSpacePath, teamInviteID) + data.Props["InviteSubInfoLink"] = fmt.Sprintf("%s/signup_user_complete/?id=%s", siteURL, teamInviteID) data.Props["AddAppsInfo"] = T("api.templates.cloud_welcome_email.add_apps_info") data.Props["AddAppsSubInfo"] = T("api.templates.cloud_welcome_email.add_apps_sub_info") data.Props["AppMarketPlace"] = T("api.templates.cloud_welcome_email.app_market_place") diff --git a/templates/cloud_welcome_email.html b/templates/cloud_welcome_email.html index e94f62ce61..19896f29fe 100644 --- a/templates/cloud_welcome_email.html +++ b/templates/cloud_welcome_email.html @@ -1,169 +1,171 @@ {{define "cloud_welcome_email"}} + + - - - + + +
- - - + +
- - - - -
- logo_email_blue -
- - - - -
-

- {{.Props.Title}} -

-

- {{.Props.Info}} {{.Props.DNS}}. - {{.Props.Info2}} -

-

- {{.Props.Button}} -

-
- - - - -
-

- {{.Props.SubTitle}} -

-

- {{.Props.SubTitleInfo}} -

-
- - - + +
-
- - - - - - - {{.Props.InviteInfo}} - + + + + + - + + +
+ + + + +
+ + + + +
+ logo_email_blue +
+ + + + +

- {{.Props.InviteSubInfo}} - + {{.Props.Title}} +

+

+ {{.Props.Info}} {{.Props.InviteSubInfoLink}} + style="text-decoration: none; color: #6DA4EB;">{{.Props.DNS}}. + {{.Props.Info2}}

- - -
- - - - - - - {{.Props.AddAppsInfo}} - +

+ {{.Props.Button}} +

+
+ + + - -

- {{.Props.AddAppsSubInfo}} - {{.Props.AppMarketPlace}} + style="font-family: Open Sans, Arial; font-weight: 600; font-size: 22px; line-height: 28px; color: #3D3C40;"> + {{.Props.SubTitle}}

- - -
- - - - - - - {{.Props.DownloadMMInfo}} -

- {{.Props.SignInSubInfo}} {{.Props.MMApps}} - {{.Props.SignInSubInfo2}} + style="font-family: Open Sans, Arial; font-style: normal; font-weight: 400; font-size: 14px; line-height: 20px; color: #3D3C40;"> + {{.Props.SubTitleInfo}}

-
-
- - - + +
-

- {{.Props.GettingStartedQuestions}} support@mattermost.com. -

+
+ + + - -
+
+ + c_avatar + + + {{.Props.InviteInfo}} + +

+ {{.Props.InviteSubInfo}} + {{.Props.InviteSubInfoLink}} +

+
-
- - - - -
- invite_illustration +
+ + + c_avatar + + + + {{.Props.AddAppsInfo}} + +

+ {{.Props.AddAppsSubInfo}} + {{.Props.AppMarketPlace}} +

+
-
- - - - -
-

- © 2021 Mattermost, Inc. 530 Lytton Avenue, Second floor, Palo Alto, CA, 94301 -

-
+
+ + + c_avatar + + + + {{.Props.DownloadMMInfo}} + +

+ {{.Props.SignInSubInfo}} {{.Props.MMApps}} + {{.Props.SignInSubInfo2}} +

+
+
+ + + - -
+

+ {{.Props.GettingStartedQuestions}} support@mattermost.com. +

-
-
+ + +
+ invite_illustration -
+
+ + + + +
+

{{.Props.Organization}} + {{.Props.FooterV2}} +

+
+
+
+ + + + {{end}}