Open platform to collect and prioritize feedback
design: improve email content
goenningb43bb739fdac
diff --git a/app/tasks/tasks.go b/app/tasks/tasks.goindex 4d30f5f5f..05e492edd 100644--- a/app/tasks/tasks.go+++ b/app/tasks/tasks.go@@ -75,6 +75,7 @@ func SendSignInEmail(model *models.SignInByEmail) worker.Task {//SendChangeEmailConfirmation is used to send the change email confirmation email to requestorfunc SendChangeEmailConfirmation(model *models.ChangeUserEmail) worker.Task {return describe("Send change email confirmation", func(c *worker.Context) error {+previous := c.User().Emailif previous == "" {previous = "(empty)"@@ -144,8 +145,8 @@ func NotifyAboutNewPost(post *models.Post) worker.Task {"userName": c.User().Name,"content": markdown.Full(post.Description),"postLink": linkWithText(fmt.Sprintf("#%d", post.Number), web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),- "view": linkWithText("View it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),- "change": linkWithText("change your notification settings", web.BaseURL(c), "/settings"),+ "view": linkWithText("view it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),+ "change": linkWithText("change your notification preferences", web.BaseURL(c), "/settings"),"logo": web.LogoURL(c),}@@ -204,9 +205,9 @@ func NotifyAboutNewComment(post *models.Post, comment *models.NewComment) worker"userName": c.User().Name,"content": markdown.Full(comment.Content),"postLink": linkWithText(fmt.Sprintf("#%d", post.Number), web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),- "view": linkWithText("View it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),+ "view": linkWithText("view it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),"unsubscribe": linkWithText("unsubscribe from it", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),- "change": linkWithText("change your notification settings", web.BaseURL(c), "/settings"),+ "change": linkWithText("change your notification preferences", web.BaseURL(c), "/settings"),"logo": web.LogoURL(c),}@@ -276,9 +277,9 @@ func NotifyAboutStatusChange(post *models.Post, prevStatus enum.PostStatus) work"content": markdown.Full(post.Response.Text),"status": post.Status.Name(),"duplicate": duplicate,- "view": linkWithText("View it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),+ "view": linkWithText("view it on your browser", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),"unsubscribe": linkWithText("unsubscribe from it", web.BaseURL(c), "/posts/%d/%s", post.Number, post.Slug),- "change": linkWithText("change your notification settings", web.BaseURL(c), "/settings"),+ "change": linkWithText("change your notification preferences", web.BaseURL(c), "/settings"),"logo": web.LogoURL(c),}@@ -334,7 +335,7 @@ func NotifyAboutDeletedPost(post *models.Post) worker.Task {"title": post.Title,"tenantName": c.Tenant().Name,"content": markdown.Full(post.Response.Text),- "change": linkWithText("change your notification settings", web.BaseURL(c), "/settings"),+ "change": linkWithText("change your notification preferences", web.BaseURL(c), "/settings"),"logo": web.LogoURL(c),}diff --git a/app/tasks/tasks_test.go b/app/tasks/tasks_test.goindex 6f7d2d206..7642e43d3 100644--- a/app/tasks/tasks_test.go+++ b/app/tasks/tasks_test.go@@ -161,8 +161,8 @@ func TestNotifyAboutNewPostTask(t *testing.T) {"tenantName": "Demonstration","userName": "Jon Snow","content": template.HTML("<p>TypeScript is great, please add support for it</p>"),- "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>View it on your browser</a>"),- "change": template.HTML("<a href='http://domain.com/settings'>change your notification settings</a>"),+ "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>view it on your browser</a>"),+ "change": template.HTML("<a href='http://domain.com/settings'>change your notification preferences</a>"),"logo": "https://getfider.com/images/logo-100x100.png",})Expect(emailmock.MessageHistory[0].From).Equals("Jon Snow")@@ -228,8 +228,8 @@ func TestNotifyAboutNewCommentTask(t *testing.T) {"tenantName": "Demonstration","userName": "Arya Stark","content": template.HTML("<p>I agree</p>"),- "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>View it on your browser</a>"),- "change": template.HTML("<a href='http://domain.com/settings'>change your notification settings</a>"),+ "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>view it on your browser</a>"),+ "change": template.HTML("<a href='http://domain.com/settings'>change your notification preferences</a>"),"unsubscribe": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>unsubscribe from it</a>"),"logo": "https://getfider.com/images/logo-100x100.png",})@@ -299,8 +299,8 @@ func TestNotifyAboutStatusChangeTask(t *testing.T) {"content": template.HTML("<p>Planned for next release.</p>"),"duplicate": template.HTML(""),"status": "planned",- "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>View it on your browser</a>"),- "change": template.HTML("<a href='http://domain.com/settings'>change your notification settings</a>"),+ "view": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>view it on your browser</a>"),+ "change": template.HTML("<a href='http://domain.com/settings'>change your notification preferences</a>"),"unsubscribe": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>unsubscribe from it</a>"),"logo": "https://getfider.com/images/logo-100x100.png",})@@ -367,7 +367,7 @@ func TestNotifyAboutDeletePostTask(t *testing.T) {"title": "Add support for TypeScript","tenantName": "Demonstration","content": template.HTML("<p>Invalid post!</p>"),- "change": template.HTML("<a href='http://domain.com/settings'>change your notification settings</a>"),+ "change": template.HTML("<a href='http://domain.com/settings'>change your notification preferences</a>"),"logo": "https://getfider.com/images/logo-100x100.png",})Expect(emailmock.MessageHistory[0].From).Equals("Jon Snow")@@ -440,8 +440,8 @@ func TestNotifyAboutStatusChangeTask_Duplicate(t *testing.T) {"content": template.HTML(""),"duplicate": template.HTML("<a href='http://domain.com/posts/1/add-support-for-typescript'>Add support for TypeScript</a>"),"status": "duplicate",- "view": template.HTML("<a href='http://domain.com/posts/2/i-need-typescript'>View it on your browser</a>"),- "change": template.HTML("<a href='http://domain.com/settings'>change your notification settings</a>"),+ "view": template.HTML("<a href='http://domain.com/posts/2/i-need-typescript'>view it on your browser</a>"),+ "change": template.HTML("<a href='http://domain.com/settings'>change your notification preferences</a>"),"unsubscribe": template.HTML("<a href='http://domain.com/posts/2/i-need-typescript'>unsubscribe from it</a>"),"logo": "https://getfider.com/images/logo-100x100.png",})@@ -472,8 +472,8 @@ func TestSendInvites(t *testing.T) {worker := mock.NewWorker()task := tasks.SendInvites("My Subject", "Click here: %invite%", []*models.UserInvitation{- &models.UserInvitation{Email: "[email protected]", VerificationKey: "1234"},- &models.UserInvitation{Email: "[email protected]", VerificationKey: "5678"},+ {Email: "[email protected]", VerificationKey: "1234"},+ {Email: "[email protected]", VerificationKey: "5678"},})err := worker.diff --git a/views/templates/base_email.tpl b/views/templates/base_email.tplindex e50c2cdd6..28cb1b100 100644--- a/views/templates/base_email.tpl+++ b/views/templates/base_email.tpl@@ -5,8 +5,8 @@<meta name="viewport" content="width=device-width"><meta http-equiv="X-UA-Compatible" content="IE=edge"></head>- <body bgcolor="#F7F7F7" style="font-size:16px">- <table width="100%" bgcolor="#F7F7F7" cellpadding="0" cellspacing="0" border="0" style="text-align:center;font-size:14px;">+ <body bgcolor="#F7F7F7" style="font-size:18px">+ <table width="100%" bgcolor="#F7F7F7" cellpadding="0" cellspacing="0" border="0" style="text-align:center;font-size:18px;"><tr><td height="40"> </td></tr>@@ -29,7 +29,7 @@</tr><tr><td>- <span style="color:#666;font-size:11px">This email was sent from a notification-only address that cannot accept incoming email. Please do not reply to this message.</span>+ <span style="color:#666;font-size:12px">This email was sent from a notification-only address that cannot accept incoming email. Please do not reply to this message.</span></td></tr><tr>diff --git a/views/templates/change_emailaddress_email.tpl b/views/templates/change_emailaddress_email.tplindex 2d7b88f1e..920916b72 100644--- a/views/templates/change_emailaddress_email.tpl+++ b/views/templates/change_emailaddress_email.tpl@@ -2,16 +2,10 @@ subject: Confirm your new emailbody:<tr><td>- <p>Hi <strong>{{ .name }}</strong>,</p>- <p>You have requested to change your email from {{ .oldEmail }} to {{ .newEmail }}.</p>- <p>Click the link below to confirm this operation.</p>- </td>-</tr>-<tr>- <td>{{ .link }}</td>-</tr>-<tr>- <td>- <span style="color:#666;font-size:11px">This link will expire in 24 hours and can only be used once.</span>+ <h2 style="color:#1c262d">Hello, {{ .name }}!</h2>+ <p style="color:#1c262d">You have requested to change your email from {{ .oldEmail }} to {{ .newEmail }}.</p>+ <p style="color:#1c262d">Click the link below to confirm this operation.</p>+ <p>{{ .link }}</p>+ <p style="color:#666;font-size:14px">Note: This link will expire in 24 hours and can only be used one time.</p></td></tr>\ No newline at end of filediff --git a/views/templates/change_status.tpl b/views/templates/change_status.tplindex da5795ff6..46ec72c9a 100644--- a/views/templates/change_status.tpl+++ b/views/templates/change_status.tpl@@ -2,27 +2,17 @@ subject: [{{ .tenantName }}] {{ .title }}body:<tr><td>- {{ if .duplicate }}- <strong>{{ .title }} ({{ .postLink }})</strong> has been closed as a <strong>{{ .status }}</strong> of {{ .duplicate }}.- {{ else }}- Status of <strong>{{ .title }} ({{ .postLink }})</strong> has changed to <strong>{{ .status }}</strong>.- {{ end }}- </td>-</tr>-<tr>- <td></td>- <td height="10" style="line-height:1px;"> </td>- <td></td>-</tr>-<tr>- <td style="border-top:1px solid #efefef;">{{ .content }}</td>-</tr>-<tr>- <td>- <span style="color:#666;font-size:11px">- — <br />- You are receiving this because you are subscribed to this thread. <br />- {{ .view }}, {{ .unsubscribe }} or {{ .change }}.- </span>+ <p style="padding-bottom:10px;border-bottom:1px solid #efefef;color:#1c262d">+ {{ if .duplicate }}+ <strong>{{ .title }} ({{ .postLink }})</strong> has been closed as a <strong>{{ .status }}</strong> of {{ .duplicate }}.+ {{ else }}+ Status of <strong>{{ .title }} ({{ .postLink }})</strong> has changed to <strong>{{ .status }}</strong>.+ {{ end }}+ </p>+ {{ .content }}+ <p style="color:#666;font-size:14px">+ — <br />+ You are receiving this email because you are subscribed to this post. You can {{ .view }}, {{ .unsubscribe }} or {{ .change }}.+ </p></td></tr>\ No newline at end of filediff --git a/views/templates/delete_post.tpl b/views/templates/delete_post.tplindex 01e39b9e6..3ffe25918 100644--- a/views/templates/delete_post.tpl+++ b/views/templates/delete_post.tpl@@ -2,23 +2,13 @@ subject: [{{ .tenantName }}] {{ .title }}body:<tr><td>- <strong>{{ .title }}</strong> has been <strong>deleted</strong>.- </td>-</tr>-<tr>- <td></td>- <td height="10" style="line-height:1px;"> </td>- <td></td>-</tr>-<tr>- <td style="border-top:1px solid #efefef;">{{ .content }}</td>-</tr>-<tr>- <td>- <span style="color:#666;font-size:11px">- — <br />- You are receiving this because you are subscribed to this thread. <br />- {{ .change }}.- </span>+ <p style="padding-bottom:10px;border-bottom:1px solid #efefef;color:#1c262d">+ <strong>{{ .title }}</strong> has been <strong>deleted</strong>.+ </p>+ {{ .content }}+ <p style="color:#666;font-size:14px">+ — <br />+ You are receiving this email because you are subscribed to this post. You can {{ .change }}.+ </p></td></tr>\ No newline at end of filediff --git a/views/templates/new_comment.tpl b/views/templates/new_comment.tplindex 530f804b8..2814d3cc1 100644--- a/views/templates/new_comment.tpl+++ b/views/templates/new_comment.tpl@@ -2,26 +2,13 @@ subject: [{{ .tenantName }}] {{ .title }}body:<tr><td>- <strong>{{ .userName }}</strong> left a comment on- <strong>- {{ .title }} ({{ .postLink }})- </strong>- </td>-</tr>-<tr>- <td></td>- <td height="10" style="line-height:1px;"> </td>- <td></td>-</tr>-<tr>- <td style="border-top:1px solid #efefef;">{{ .content }}</td>-</tr>-<tr>- <td>- <span style="color:#666;font-size:11px">- — <br />- You are receiving this because you are subscribed to this thread. <br />- {{ .view }}, {{ .unsubscribe }} or {{ .change }}.- </span>+ <p style="padding-bottom:10px;border-bottom:1px solid #efefef;color:#1c262d">+ <strong>{{ .userName }}</strong> left a comment on <strong>{{ .title }} ({{ .postLink }})</strong>+ </p>+ {{ .content }}+ <p style="color:#666;font-size:14px">+ — <br />+ You are receiving this email because you are subscribed to this post. You can {{ .view }}, {{ .unsubscribe }} or {{ .change }}.+ </p></td></tr>\ No newline at end of filediff --git a/views/templates/new_post.tpl b/views/templates/new_post.tplindex cb2ce68a1..48c6d1a42 100644--- a/views/templates/new_post.tpl+++ b/views/templates/new_post.tpl@@ -2,23 +2,13 @@ subject: [{{ .tenantName }}] {{ .title }}body:<tr><td>- <strong>{{ .userName }}</strong> created a new post <strong>{{ .title }} ({{ .postLink }})</strong>.- </td>-</tr>-<tr>- <td></td>- <td height="10" style="line-height:1px;"> </td>- <td></td>-</tr>-<tr>- <td style="border-top:1px solid #efefef;">{{ .content }}</td>-</tr>-<tr>- <td>- <span style="color:#666;font-size:11px">- — <br />- You are receiving this because you are subscribed to this event. <br />- {{ .view }} or {{ .change }}.- </span>+ <p style="padding-bottom:10px;border-bottom:1px solid #efefef;color:#1c262d">+ <strong>{{ .userName }}</strong> created a new post <strong>{{ .title }} ({{ .postLink }})</strong>.+ </p>+ {{ .content }}+ <p style="color:#666;font-size:14px">+ — <br />+ You are receiving this email because you are subscribed to this site. You can {{ .view }} or {{ .change }}.+ </p></td></tr>\ No newline at end of filediff --git a/views/templates/signin_email.tpl b/views/templates/signin_email.tplindex 5c530170a..f4a764988 100644--- a/views/templates/signin_email.tpl+++ b/views/templates/signin_email.tpl@@ -1,16 +1,11 @@subject: Sign in to {{ .tenantName }}body:-<tr>- <td>Click the link below to sign in to <strong>{{ .tenantName }}</strong>.</td>-</tr>-<tr>- <td height="20"> </td>-</tr>-<tr>- <td>{{ .link }}</td>-</tr><tr><td>- <span style="color:#666;font-size:11px">This link will expire in 30 minutes and can only be used once.</span>+ <h2 style="color:#1c262d">Hello!</h2>+ <p style="color:#1c262d">You asked us to send you a sign-in link and here it is.</p>+ <p style="color:#1c262d">Click the link below to sign in to <strong>{{ .tenantName }}</strong>.</p>+ <p>{{ .link }}</p>+ <p style="color:#666;font-size:14px">Note: This link will expire in 30 minutes and can only be used one time.</p></td></tr>\ No newline at end of filediff --git a/views/templates/signup_email.tpl b/views/templates/signup_email.tplindex a509f6f94..b4d4613a2 100644--- a/views/templates/signup_email.tpl+++ b/views/templates/signup_email.tpl@@ -1,16 +1,11 @@-subject: Confirm your new Fider site+subject: Your new Fider sitebody:-<tr>- <td>Click the link below to confirm your new Fider site.</td>-</tr>-<tr>- <td height="20"> </td>-</tr>-<tr>- <td>{{ .link }}</td>-</tr><tr><td>- <span style="color:#666;font-size:11px">This link will expire in 48 hours and can only be used once.</span>+ <h2 style="color:#1c262d">Hello!</h2>+ <p style="color:#1c262d">You are one step away from activating your Fider site.</p>+ <p style="color:#1c262d">Through the link below you can verify your email address and complete the activation process.</p>+ <p>{{ .link }}</p>+ <p style="color:#666;font-size:14px">Note: This link will expire in 48 hours and can only be used one time.</p></td>-</tr>+</tr>\ No newline at end of file