# HG changeset patch # User Mads Kiilerich # Date 2016-07-28 16:44:24 # Node ID 8b75085c2c026fa0cae75f6fa56728297e9e451f # Parent 8bd957e6cccbfd17b2963d9b52625fed8eff30e6 mails: restructure notification mail content * Mention "The Thing" in the header, link to online version * Show The Thing * A dense summary of the essentials of the context below it The html indentation is odd in order to make the next diff smaller. The text version is based on: for a in kallithea/templates/email_templates/*.html; do sed -e 's,<\([^%/>]\|/[^%>]\)*>,,g' -e 's,\.html",\.txt",g' -e 's,^ *,,g' -e 's/}/|n,unicode}/g' $a > ${a%%.html}.txt ; done diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -88,6 +88,7 @@ class ChangesetCommentsModel(BaseModel): 'cs_comment_user': user.full_name_and_username, 'cs_target_repo': h.canonical_url('summary_home', repo_name=repo.repo_name), 'cs_comment_url': comment_url, + 'cs_url': h.canonical_url('changeset_home', repo_name=repo.repo_name, revision=revision), 'raw_id': revision, 'message': cs.message, 'message_short': h.shorter(cs.message, 50, firstline=True), @@ -137,6 +138,7 @@ class ChangesetCommentsModel(BaseModel): 'status_change': status_change, 'closing_pr': closing_pr, 'pr_comment_url': comment_url, + 'pr_url': pull_request.url(canonical=True), 'pr_comment_user': user.full_name_and_username, 'pr_target_repo': h.canonical_url('summary_home', repo_name=pull_request.other_repo.repo_name), diff --git a/kallithea/model/user.py b/kallithea/model/user.py --- a/kallithea/model/user.py +++ b/kallithea/model/user.py @@ -198,7 +198,9 @@ class UserModel(BaseModel): edit_url = h.canonical_url('edit_user', id=new_user.user_id) email_kwargs = { 'registered_user_url': edit_url, - 'new_username': new_user.username} + 'new_username': new_user.username, + 'new_email': new_user.email, + 'new_full_name': new_user.full_name} NotificationModel().create(created_by=new_user, subject=subject, body=body, recipients=None, type_=Notification.TYPE_REGISTRATION, diff --git a/kallithea/templates/email_templates/button.html b/kallithea/templates/email_templates/button.html new file mode 100644 --- /dev/null +++ b/kallithea/templates/email_templates/button.html @@ -0,0 +1,8 @@ +<%page args="url,title='',padding_top=True,padding_bottom=True" />\ +## +

+ + ${_(title)} + +

+## diff --git a/kallithea/templates/email_templates/button.txt b/kallithea/templates/email_templates/button.txt new file mode 100644 --- /dev/null +++ b/kallithea/templates/email_templates/button.txt @@ -0,0 +1,3 @@ +<%page args="url,title" />\ + +${title|n,unicode}: ${url} diff --git a/kallithea/templates/email_templates/changeset_comment.html b/kallithea/templates/email_templates/changeset_comment.html --- a/kallithea/templates/email_templates/changeset_comment.html +++ b/kallithea/templates/email_templates/changeset_comment.html @@ -1,20 +1,19 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.html"/> - -%if is_mention: -

${_('Comment from %s on %s changeset %s mentioned you') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))}:

-%else: -

${_('Comment from %s on %s changeset %s') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))}:

-%endif -

${body}

- -%if status_change: -

${_('The changeset status was changed to')}: ${status_change}

-%endif - -

${_('URL')}: ${cs_comment_url}

- -

${_('Changeset')}: ${h.short_id(raw_id)}

-

${_('Description')}:
-${h.shorter(message, 256)} -

+<%inherit file="main.html"/>\ +\ +<%block name="header">\ +<% title = _('Mention in Comment on Changeset "%s"') % h.shorter(message, 200, firstline=True) if is_mention else _('Comment on Changeset "%s"') % h.shorter(message, 200, firstline=True) %>\ +<%include file="header.html" args="title=title,link=cs_comment_url"/>\ +\ +\ +<%include file="comment.html" args="text=body,author=cs_comment_user,status=status_change"/>\ +

+ ${_('Changeset on')} + ${cs_target_repo} + ${_('branch')} + ${branch}: +
+ "${h.shorter(message, 60, firstline=True)}" + ${_('by')} + ${cs_author.full_name_and_username}. +

+<%include file="button.html" args="url=cs_comment_url,title=_('View Comment'),padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/changeset_comment.txt b/kallithea/templates/email_templates/changeset_comment.txt --- a/kallithea/templates/email_templates/changeset_comment.txt +++ b/kallithea/templates/email_templates/changeset_comment.txt @@ -1,19 +1,16 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.txt"/> +<%block name="header">\ +<% title = _('Mention in Comment on Changeset "%s"') % h.shorter(message, 200, firstline=True) if is_mention else _('Comment on Changeset "%s"') % h.shorter(message, 200, firstline=True) %>\ +<%include file="header.txt" args="title=title,link=cs_comment_url"/>\ +\ -%if is_mention: -${_('Comment from %s on %s changeset %s mentioned you') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))|n,unicode}: -%else: -${_('Comment from %s on %s changeset %s') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))|n,unicode}: -%endif -${body|n,unicode} +<%include file="comment.txt" args="text=body,author=cs_comment_user,status=status_change"/>\ -%if status_change: -${_('The changeset status was changed to')|n,unicode}: ${status_change|n,unicode} -%endif +${_('Changeset on')|n,unicode} \ +${cs_target_repo|n,unicode} \ +${_('branch')|n,unicode} \ +${branch|n,unicode}: +"${h.shorter(message, 60, firstline=True)|n,unicode}" \ +${_('by')|n,unicode} \ +${cs_author.full_name_and_username|n,unicode}. -${_('URL')|n,unicode}: ${cs_comment_url|n,unicode} - -${_('Changeset')|n,unicode}: ${h.short_id(raw_id)|n,unicode} -${_('Description')|n,unicode}: -${h.shorter(message, 256)|n,unicode} +<%include file="button.txt" args="url=cs_comment_url,title=_('View Comment')"/>\ diff --git a/kallithea/templates/email_templates/comment.html b/kallithea/templates/email_templates/comment.html new file mode 100644 --- /dev/null +++ b/kallithea/templates/email_templates/comment.html @@ -0,0 +1,17 @@ +<%page args="author,text,status,close=False" />\ +\ +## +

+ %if link is not None: + ${title} + %else: + ${title} + %endif +

+## diff --git a/kallithea/templates/email_templates/header.txt b/kallithea/templates/email_templates/header.txt new file mode 100644 --- /dev/null +++ b/kallithea/templates/email_templates/header.txt @@ -0,0 +1,8 @@ +<%page args="title,link" />\ +%if link is not None: +${link} + +%endif +${title|n,unicode} + +## Trailing empty line diff --git a/kallithea/templates/email_templates/main.html b/kallithea/templates/email_templates/main.html --- a/kallithea/templates/email_templates/main.html +++ b/kallithea/templates/email_templates/main.html @@ -6,10 +6,8 @@ -${self.body()} -
-
---
-${_("This is an automatic notification. Don't reply to this mail.")} + ## +${self.body()}\ + ## diff --git a/kallithea/templates/email_templates/main.txt b/kallithea/templates/email_templates/main.txt deleted file mode 100644 --- a/kallithea/templates/email_templates/main.txt +++ /dev/null @@ -1,4 +0,0 @@ -${self.body()|n,unicode} - --- -${_("This is an automatic notification. Don't reply to this mail.")|n,unicode} diff --git a/kallithea/templates/email_templates/password_reset.html b/kallithea/templates/email_templates/password_reset.html --- a/kallithea/templates/email_templates/password_reset.html +++ b/kallithea/templates/email_templates/password_reset.html @@ -1,16 +1,26 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.html"/> - -

${_('Hello %s') % user}

+<%inherit file="main.html"/>\ +\ +<%block name="header">\ +<%include file="header.html" args="title=_('Password Reset Request'),link=None"/>\ +\ +\ +

${_('Hello %s') % user},

+

+ ${_('We have received a request to reset the password for your account.')} +

+

-

${_('We have received a request to reset the password for your account.')}

-%if reset_token is None: -

${_('This account is however managed outside this system and the password cannot be changed here.')}

-%else: -

${_('To set a new password, click the following link')}:

-

${reset_url}

- -

${_("Should you not be able to use the link above, please type the following code into the password reset form")}: ${reset_token}

-%endif - -

${_("If it weren't you who requested the password reset, just disregard this message.")}

+ %if reset_token is None: + ${_('This account is however managed outside this system and the password cannot be changed here.')} + %else: + ${_('To set a new password, click the following link')}: +
+ ${reset_url} +
+ ${_("Should you not be able to use the link above, please type the following code into the password reset form")}: + ${reset_token} + %endif +

+ ${_("If it weren't you who requested the password reset, just disregard this message.")} +

diff --git a/kallithea/templates/email_templates/password_reset.txt b/kallithea/templates/email_templates/password_reset.txt --- a/kallithea/templates/email_templates/password_reset.txt +++ b/kallithea/templates/email_templates/password_reset.txt @@ -1,9 +1,11 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.txt"/> - -${_('Hello %s') % user|n,unicode} +<%block name="header">\ +<%include file="header.txt" args="title=_('Password Reset Request'),link=None"/>\ +\ +\ +${_('Hello %s') % user|n,unicode}, ${_('We have received a request to reset the password for your account.')|n,unicode} + %if reset_token is None: ${_('This account is however managed outside this system and the password cannot be changed here.')|n,unicode} %else: @@ -11,7 +13,8 @@ ${_('To set a new password, click the fo ${reset_url|n,unicode} -${_("Should you not be able to use the link above, please type the following code into the password reset form")|n,unicode}: ${reset_token|n,unicode} +${_("Should you not be able to use the link above, please type the following code into the password reset form")|n,unicode}: +${reset_token|n,unicode} %endif ${_("If it weren't you who requested the password reset, just disregard this message.")|n,unicode} diff --git a/kallithea/templates/email_templates/pull_request.html b/kallithea/templates/email_templates/pull_request.html --- a/kallithea/templates/email_templates/pull_request.html +++ b/kallithea/templates/email_templates/pull_request.html @@ -1,22 +1,37 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.html"/> - -%if is_mention: -

${_('%s mentioned you on %s pull request "%s"') % (pr_user_created, repo_name, pr_title)}

-%else: -

${_('%s requested your review of %s pull request "%s"') % (pr_user_created, repo_name, pr_title)}

-%endif - -

${_('URL')}: ${pr_url}

- -

${_('Description')}:

-

${body}

- -

${_('Changesets')}:

-

-%for r,r_msg in pr_revisions: -${h.short_id(r)}: -${h.shorter(r_msg, 256)} - -%endfor -

+<%inherit file="main.html"/>\ +\ +<%block name="header">\ +<% title = _('Mention on Pull Request %s "%s" by %s') % (pr_nice_id, pr_title, pr_user_created) if is_mention else _('Added as Reviewer of Pull Request %s "%s" by %s') % (pr_nice_id, pr_title, pr_user_created) %>\ +<%include file="header.html" args="title=title,link=pr_url"/>\ +\ +\ +

+ ${_('Pull request from')} + ${pr_source_repo} + ${_('at')} + ${pr_source_branch} + ${_('to')} + ${pr_target_repo} + ${_('at')} + ${pr_target_branch}: +
+ ${pr_nice_id} + "${pr_title}" + ${_('by')} + ${pr_owner.full_name_and_username}. +

+

+ ${_('Description')}: +

+
${body}
+

${_('Changesets')}:

+ +<%include file="button.html" args="url=pr_url,title=_('View Pull Request'),padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/pull_request.txt b/kallithea/templates/email_templates/pull_request.txt --- a/kallithea/templates/email_templates/pull_request.txt +++ b/kallithea/templates/email_templates/pull_request.txt @@ -1,20 +1,31 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.txt"/> +<%block name="header">\ +<% title = _('Mention on Pull Request %s "%s" by %s') % (pr_nice_id, pr_title, pr_user_created) if is_mention else _('Added as Reviewer of Pull Request %s "%s" by %s') % (pr_nice_id, pr_title, pr_user_created) %>\ +<%include file="header.txt" args="title=title,link=pr_url"/>\ +\ -%if is_mention: -${_('%s mentioned you on %s pull request "%s"') % (pr_user_created, repo_name, pr_title)|n,unicode} -%else: -${_('%s requested your review of %s pull request "%s"') % (pr_user_created, repo_name, pr_title)|n,unicode} -%endif +${_('Pull request from')|n,unicode} \ +${pr_source_repo|n,unicode} \ +${_('at')|n,unicode} \ +${pr_source_branch|n,unicode} \ +${_('to')|n,unicode} \ +${pr_target_repo|n,unicode} \ +${_('at')|n,unicode} \ +${pr_target_branch|n,unicode}: +${pr_nice_id|n,unicode} \ +"${pr_title|n,unicode}" \ +${_('by')|n,unicode} \ +${pr_owner.full_name_and_username|n,unicode}. -${_('URL')|n,unicode}: ${pr_url|n,unicode} ${_('Description')|n,unicode}: + ${body|n,unicode} + ${_('Changesets')|n,unicode}: -%for r,r_msg in pr_revisions: -${h.short_id(r)|n,unicode}: ${h.canonical_url('changeset_home', repo_name=org_repo_name, revision=r)} -${h.shorter(r_msg, 256)|n,unicode} +%for revision, desc in pr_revisions: +${h.shorter(desc, 80, firstline=True)|n,unicode} %endfor + +<%include file="button.txt" args="url=pr_url,title='View Pull Request'"/>\ diff --git a/kallithea/templates/email_templates/pull_request_comment.html b/kallithea/templates/email_templates/pull_request_comment.html --- a/kallithea/templates/email_templates/pull_request_comment.html +++ b/kallithea/templates/email_templates/pull_request_comment.html @@ -1,15 +1,24 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.html"/> - -

${_('Comment from %s on %s pull request "%s"') % (pr_comment_user, repo_name, pr_title)}:

-

${body}

- -%if status_change: - %if closing_pr: -

${_('The comment closed the pull request with status')}: ${status_change}

- %else: -

${_('The comment was made with status')}: ${status_change}

- %endif -%endif - -

${_('URL')}: ${pr_comment_url}

+<%inherit file="main.html"/>\ +\ +<%block name="header">\ +<% title = _('Mention in Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) if is_mention else _('Pull Request %s "%s" Closed') % (pr_nice_id, pr_title) if closing_pr else _('Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) %>\ +<%include file="header.html" args="title=title,link=pr_comment_url"/>\ +\ +\ +<%include file="comment.html" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\ +

+ ${_('Pull request from')} + ${pr_source_repo} + ${_('at')} + ${pr_source_branch} + ${_('to')} + ${pr_target_repo} + ${_('at')} + ${pr_target_branch}: +
+ ${pr_nice_id} + "${pr_title}" + ${_('by')} + ${pr_owner.full_name_and_username}. +

+<%include file="button.html" args="url=pr_comment_url,title=_('View Comment'),padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/pull_request_comment.txt b/kallithea/templates/email_templates/pull_request_comment.txt --- a/kallithea/templates/email_templates/pull_request_comment.txt +++ b/kallithea/templates/email_templates/pull_request_comment.txt @@ -1,15 +1,21 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.txt"/> +<%block name="header">\ +<% title = _('Mention in Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) if is_mention else _('Pull Request %s "%s" Closed') % (pr_nice_id, pr_title) if closing_pr else _('Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) %>\ +<%include file="header.txt" args="title=title,link=pr_comment_url"/>\ +\ -${_('Comment from %s on %s pull request "%s"') % (pr_comment_user, repo_name, pr_title)|n,unicode}: -${body|n,unicode} +<%include file="comment.txt" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\ -%if status_change: - %if closing_pr: -${_('The comment closed the pull request with status')|n,unicode}: ${status_change|n,unicode} - %else: -${_('The comment was made with status')|n,unicode}: ${status_change|n,unicode} - %endif -%endif +${_('Pull request from')|n,unicode} \ +${pr_source_repo|n,unicode} \ +${_('at')|n,unicode} \ +${pr_source_branch|n,unicode} \ +${_('to')|n,unicode} \ +${pr_target_repo|n,unicode} \ +${_('at')|n,unicode} \ +${pr_target_branch|n,unicode}: +${pr_nice_id|n,unicode} \ +"${pr_title|n,unicode}" \ +${_('by')|n,unicode} \ +${pr_owner.full_name_and_username|n,unicode}. -${_('URL')|n,unicode}: ${pr_comment_url|n,unicode} +<%include file="button.txt" args="url=pr_comment_url,title=_('View Comment')"/>\ diff --git a/kallithea/templates/email_templates/registration.html b/kallithea/templates/email_templates/registration.html --- a/kallithea/templates/email_templates/registration.html +++ b/kallithea/templates/email_templates/registration.html @@ -1,6 +1,23 @@ ## -*- coding: utf-8 -*- -<%inherit file="main.html"/> - -${body} - -${_('View this user here')}: ${registered_user_url} +<%inherit file="main.html"/>\ +\ +<%block name="header">\ +<%include file="header.html" args="title=_('New User Registration'),link=registered_user_url"/>\ +\ +\ +

+ ${_('Username')}: +
+ ${new_username} +

+

+ ${_('Full Name')}: +
+ ${new_full_name} +

+

+ ${_('Email')}: +
+ ${new_email} +

+<%include file="button.html" args="url=registered_user_url,title=_('View User Profile'),padding_bottom=False"/>\ diff --git a/kallithea/templates/email_templates/registration.txt b/kallithea/templates/email_templates/registration.txt --- a/kallithea/templates/email_templates/registration.txt +++ b/kallithea/templates/email_templates/registration.txt @@ -1,6 +1,11 @@ -## -*- coding: utf-8 -*- -<%inherit file="main.txt"/> +<%block name="header">\ +<%include file="header.txt" args="title=_('New User Registration'),link=registered_user_url"/>\ +\ + +${_('Username')|n,unicode}: ${new_username|n,unicode} -${body|n,unicode} +${_('Full Name')|n,unicode}: ${new_full_name|n,unicode} -${_('View this user here')|n,unicode}: ${registered_user_url|n,unicode} +${_('Email')|n,unicode}: ${new_email|n,unicode} + +<%include file="button.txt" args="url=registered_user_url,title='View User Profile'"/>\ diff --git a/kallithea/tests/models/test_dump_html_mails.ref.html b/kallithea/tests/models/test_dump_html_mails.ref.html --- a/kallithea/tests/models/test_dump_html_mails.ref.html +++ b/kallithea/tests/models/test_dump_html_mails.ref.html @@ -10,23 +10,23 @@ To: u2@example.com Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
-
+
http://comment.org
+
+Comment on Changeset "This changeset did something clever which is hard to explain"
 
-Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:
+
+Opinionated User (jsmith):
+
 This is the new comment.
 
  - and here it ends indented.
 
 
-URL: http://comment.org
-
-Changeset: cafe1234c0ff
-Description:
-This changeset did something clever which is hard to explain
+Changeset on repo_target branch brunch:
+"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://comment.org
 

@@ -37,25 +37,29 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:

-

This is the new comment. - - - and here it ends indented.

- - -

URL: http://comment.org

+

+ Comment on Changeset "This changeset did something clever which is hard to explain" +

+

Opinionated User (jsmith)

+
This is the new comment. -

Changeset: cafe1234c0ff

-

Description:
-This changeset did something clever which is hard to explain + - and here it ends indented.

+

+ Changeset on + repo_target + branch + brunch: +
+ "This changeset did something clever which is hard to explain" + by + u2 u3 (u2). +

+

+ + View Comment +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -67,23 +71,23 @@ To: u2@example.com Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch

-
+
http://comment.org
+
+Mention in Comment on Changeset "This changeset did something clever which is hard to explain"
 
-Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:
+
+Opinionated User (jsmith):
+
 This is the new comment.
 
  - and here it ends indented.
 
 
-URL: http://comment.org
-
-Changeset: cafe1234c0ff
-Description:
-This changeset did something clever which is hard to explain
+Changeset on repo_target branch brunch:
+"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://comment.org
 

@@ -94,25 +98,29 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:

-

This is the new comment. - - - and here it ends indented.

- - -

URL: http://comment.org

+

+ Mention in Comment on Changeset "This changeset did something clever which is hard to explain" +

+

Opinionated User (jsmith)

+
This is the new comment. -

Changeset: cafe1234c0ff

-

Description:
-This changeset did something clever which is hard to explain + - and here it ends indented.

+

+ Changeset on + repo_target + branch + brunch: +
+ "This changeset did something clever which is hard to explain" + by + u2 u3 (u2). +

+

+ + View Comment +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -124,24 +132,25 @@ To: u2@example.com Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch

-
+
http://comment.org
+
+Comment on Changeset "This changeset did something clever which is hard to explain"
+
 
-Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:
+Opinionated User (jsmith):
+
+Status change: Approved
+
 This is the new comment.
 
  - and here it ends indented.
 
-The changeset status was changed to: Approved
 
-URL: http://comment.org
-
-Changeset: cafe1234c0ff
-Description:
-This changeset did something clever which is hard to explain
+Changeset on repo_target branch brunch:
+"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://comment.org
 

@@ -152,26 +161,33 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:

-

This is the new comment. - - - and here it ends indented.

- -

The changeset status was changed to: Approved

+

+ Comment on Changeset "This changeset did something clever which is hard to explain" +

+

Opinionated User (jsmith)

+

+ Status change: + Approved +

+
This is the new comment. -

URL: http://comment.org

- -

Changeset: cafe1234c0ff

-

Description:
-This changeset did something clever which is hard to explain + - and here it ends indented.

+

+ Changeset on + repo_target + branch + brunch: +
+ "This changeset did something clever which is hard to explain" + by + u2 u3 (u2). +

+

+ + View Comment +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -183,24 +199,25 @@ To: u2@example.com Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch

-
+
http://comment.org
+
+Mention in Comment on Changeset "This changeset did something clever which is hard to explain"
+
 
-Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:
+Opinionated User (jsmith):
+
+Status change: Approved
+
 This is the new comment.
 
  - and here it ends indented.
 
-The changeset status was changed to: Approved
 
-URL: http://comment.org
-
-Changeset: cafe1234c0ff
-Description:
-This changeset did something clever which is hard to explain
+Changeset on repo_target branch brunch:
+"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://comment.org
 

@@ -211,26 +228,33 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:

-

This is the new comment. - - - and here it ends indented.

- -

The changeset status was changed to: Approved

+

+ Mention in Comment on Changeset "This changeset did something clever which is hard to explain" +

+

Opinionated User (jsmith)

+

+ Status change: + Approved +

+
This is the new comment. -

URL: http://comment.org

- -

Changeset: cafe1234c0ff

-

Description:
-This changeset did something clever which is hard to explain + - and here it ends indented.

+

+ Changeset on + repo_target + branch + brunch: +
+ "This changeset did something clever which is hard to explain" + by + u2 u3 (u2). +

+

+ + View Comment +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -242,15 +266,8 @@ To: u2@example.com Subject: Test Message

-
-
-This is the body of the test message
- - nothing interesting here except indentation.
-
-
--- 
-This is an automatic notification. Don't reply to this mail.
-
+
This is the body of the test message
+ - nothing interesting here except indentation.

@@ -260,15 +277,11 @@ This is an automatic notification. Don't - - -
This is the body of the test message - - nothing interesting here except indentation.
- -
-
---
-This is an automatic notification. Don't reply to this mail. +

+ Message +

+
This is the body of the test message + - nothing interesting here except indentation.

@@ -280,15 +293,19 @@ To: u2@example.com Subject: New user newbie registered
-
+
http://newbie.org
 
-Registration body
-
-View this user here: http://newbie.org
+New User Registration
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+Username: newbie
+
+Full Name: New Full Name
+
+Email: new@email.com
+
+
+View User Profile: http://newbie.org
 

@@ -299,16 +316,30 @@ This is an automatic notification. Don't - - -
Registration body
- -View this user here: http://newbie.org - -
-
---
-This is an automatic notification. Don't reply to this mail. +

+ New User Registration +

+

+ Username: +
+ newbie +

+

+ Full Name: +
+ New Full Name +

+

+ Email: +
+ new@email.com +

+

+ + View User Profile + +


@@ -320,29 +351,28 @@ To: u2@example.com Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/7
+
+Added as Reviewer of Pull Request #7 "The Title" by Requesting User (root)
 
-Requesting User (root) requested your review of repo/name pull request "The Title"
 
-URL: http://pr.org/7
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
+
 
 Description:
+
 This PR is awesome because it does stuff
  - please approve indented!
 
-Changesets:
-123abc123abc: http://changeset_home/?repo_name=repo_org&revision=123abc123abc123abc123abc123abc123abc123abc
-Introduce one and two
 
-and that's it
+Changesets:
 
-567fed567fed: http://changeset_home/?repo_name=repo_org&revision=567fed567fed567fed567fed567fed567fed567fed
+Introduce one and two
 Make one plus two equal tree
 
 
-
--- 
-This is an automatic notification. Don't reply to this mail.
+View Pull Request: http://pr.org/7
 

@@ -353,32 +383,48 @@ This is an automatic notification. Don't - - -

Requesting User (root) requested your review of repo/name pull request "The Title"

- -

URL: http://pr.org/7

- -

Description:

-

This PR is awesome because it does stuff - - please approve indented!

- -

Changesets:

-

-123abc123abc: -Introduce one and two - -and that's it - -567fed567fed: -Make one plus two equal tree - +

+ Added as Reviewer of Pull Request #7 "The Title" by Requesting User (root) +

+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ Description: +

+
This PR is awesome because it does stuff + - please approve indented!
+

Changesets:

+ +

+ + View Pull Request +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -390,29 +436,28 @@ To: u2@example.com Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/7
+
+Mention on Pull Request #7 "The Title" by Requesting User (root)
 
-Requesting User (root) mentioned you on repo/name pull request "The Title"
 
-URL: http://pr.org/7
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
+
 
 Description:
+
 This PR is awesome because it does stuff
  - please approve indented!
 
-Changesets:
-123abc123abc: http://changeset_home/?repo_name=repo_org&revision=123abc123abc123abc123abc123abc123abc123abc
-Introduce one and two
 
-and that's it
+Changesets:
 
-567fed567fed: http://changeset_home/?repo_name=repo_org&revision=567fed567fed567fed567fed567fed567fed567fed
+Introduce one and two
 Make one plus two equal tree
 
 
-
--- 
-This is an automatic notification. Don't reply to this mail.
+View Pull Request: http://pr.org/7
 

@@ -423,32 +468,48 @@ This is an automatic notification. Don't - - -

Requesting User (root) mentioned you on repo/name pull request "The Title"

- -

URL: http://pr.org/7

- -

Description:

-

This PR is awesome because it does stuff - - please approve indented!

- -

Changesets:

-

-123abc123abc: -Introduce one and two - -and that's it - -567fed567fed: -Make one plus two equal tree - +

+ Mention on Pull Request #7 "The Title" by Requesting User (root) +

+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ Description: +

+
This PR is awesome because it does stuff + - please approve indented!
+

Changesets:

+ +

+ + View Pull Request +

- -
-
---
-This is an automatic notification. Don't reply to this mail.
@@ -460,19 +521,23 @@ To: u2@example.com Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Comment on Pull Request #7 "The Title"
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+
+Opinionated User (jsmith):
+
 Me too!
 
  - and indented on second line
 
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -483,20 +548,34 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+
Me too! - -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -508,19 +587,23 @@ To: u2@example.com Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Mention in Comment on Pull Request #7 "The Title"
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+
+Opinionated User (jsmith):
+
 Me too!
 
  - and indented on second line
 
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -531,20 +614,34 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Mention in Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+
Me too! - -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -556,20 +653,25 @@ To: u2@example.com Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Comment on Pull Request #7 "The Title"
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+Status change: Under Review
+
 Me too!
 
  - and indented on second line
 
-The comment was made with status: Under Review
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -580,21 +682,38 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+

+ Status change: + Under Review +

+
Me too! -

The comment was made with status: Under Review

- -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -606,20 +725,25 @@ To: u2@example.com Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Mention in Comment on Pull Request #7 "The Title"
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+Status change: Under Review
+
 Me too!
 
  - and indented on second line
 
-The comment was made with status: Under Review
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -630,21 +754,38 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Mention in Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+

+ Status change: + Under Review +

+
Me too! -

The comment was made with status: Under Review

- -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -656,19 +797,25 @@ To: u2@example.com Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Pull Request #7 "The Title" Closed
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+The pull request has been closed.
+
 Me too!
 
  - and indented on second line
 
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -679,20 +826,37 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Pull Request #7 "The Title" Closed +

+

Opinionated User (jsmith)

+

+ The pull request has been closed. +

+
Me too! - -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -704,19 +868,25 @@ To: u2@example.com Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Mention in Comment on Pull Request #7 "The Title"
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+The pull request has been closed.
+
 Me too!
 
  - and indented on second line
 
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -727,20 +897,37 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Mention in Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+

+ The pull request has been closed. +

+
Me too! - -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -752,20 +939,27 @@ To: u2@example.com Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Pull Request #7 "The Title" Closed
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+Status change: Under Review
+
+The pull request has been closed.
+
 Me too!
 
  - and indented on second line
 
-The comment closed the pull request with status: Under Review
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -776,21 +970,41 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Pull Request #7 "The Title" Closed +

+

Opinionated User (jsmith)

+

+ Status change: + Under Review +

+

+ The pull request has been closed. +

+
Me too! -

The comment closed the pull request with status: Under Review

- -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -802,20 +1016,27 @@ To: u2@example.com Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2

-
+
http://pr.org/comment
+
+Mention in Comment on Pull Request #7 "The Title"
+
 
-Comment from Opinionated User (jsmith) on repo/name pull request "The Title":
+Opinionated User (jsmith):
+
+Status change: Under Review
+
+The pull request has been closed.
+
 Me too!
 
  - and indented on second line
 
-The comment closed the pull request with status: Under Review
 
-URL: http://pr.org/comment
+Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
+#7 "The Title" by u2 u3 (u2).
 
 
--- 
-This is an automatic notification. Don't reply to this mail.
+View Comment: http://pr.org/comment
 

@@ -826,21 +1047,41 @@ This is an automatic notification. Don't - - -

Comment from Opinionated User (jsmith) on repo/name pull request "The Title":

-

Me too! - - - and indented on second line

+

+ Mention in Comment on Pull Request #7 "The Title" +

+

Opinionated User (jsmith)

+

+ Status change: + Under Review +

+

+ The pull request has been closed. +

+
Me too! -

The comment closed the pull request with status: Under Review

- -

URL: http://pr.org/comment

- -
-
---
-This is an automatic notification. Don't reply to this mail. + - and indented on second line
+

+ Pull request from + https://dev.org/repo + at + devbranch + to + http://mainline.com/repo + at + trunk: +
+ #7 + "The Title" + by + u2 u3 (u2). +

+

+ + View Comment + +


@@ -852,22 +1093,20 @@ To: john@doe.com Subject: Password reset link

-
+
Password Reset Request
 
-Hello John Doe
+Hello John Doe,
 
 We have received a request to reset the password for your account.
+
 To set a new password, click the following link:
 
 http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746
 
-Should you not be able to use the link above, please type the following code into the password reset form: decbf64715098db5b0bd23eab44bd792670ab746
+Should you not be able to use the link above, please type the following code into the password reset form:
+decbf64715098db5b0bd23eab44bd792670ab746
 
 If it weren't you who requested the password reset, just disregard this message.
-
-
--- 
-This is an automatic notification. Don't reply to this mail.
 

@@ -878,22 +1117,25 @@ This is an automatic notification. Don't - - -

Hello John Doe

- -

We have received a request to reset the password for your account.

-

To set a new password, click the following link:

-

http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746

+

+ Password Reset Request +

+

Hello John Doe,

+

+ We have received a request to reset the password for your account. +

+

-

Should you not be able to use the link above, please type the following code into the password reset form: decbf64715098db5b0bd23eab44bd792670ab746

- -

If it weren't you who requested the password reset, just disregard this message.

- -
-
---
-This is an automatic notification. Don't reply to this mail. + To set a new password, click the following link: +
+ http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746 +
+ Should you not be able to use the link above, please type the following code into the password reset form: + decbf64715098db5b0bd23eab44bd792670ab746 +

+ If it weren't you who requested the password reset, just disregard this message. +


diff --git a/kallithea/tests/models/test_notifications.py b/kallithea/tests/models/test_notifications.py --- a/kallithea/tests/models/test_notifications.py +++ b/kallithea/tests/models/test_notifications.py @@ -49,7 +49,7 @@ class TestNotifications(TestController): def send_email(recipients, subject, body='', html_body='', headers=None, author=None): assert recipients == ['u2@example.com'] assert subject == 'Test Message' - assert body == "\n\nhi there\n\n\n-- \nThis is an automatic notification. Don't reply to this mail.\n" + assert body == u"hi there" assert '>hi there<' in html_body assert author.username == 'u1' with mock.patch.object(kallithea.lib.celerylib.tasks, 'send_email', send_email): diff --git a/scripts/whitespacecleanup.sh b/scripts/whitespacecleanup.sh --- a/scripts/whitespacecleanup.sh +++ b/scripts/whitespacecleanup.sh @@ -2,7 +2,7 @@ # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes -files=`hg loc '*.py' '*.html' '*.css' '*.rst' '*.txt' '*.js' '*.ini' '*.cfg' CONTRIBUTORS LICENSE.md | egrep -v '/lockfiles.py|LICENSE-MERGELY.html|/codemirror/|/fontello/|(graph|mergely|native.history|select2/select2|yui.flot|yui.2.9|jquery.dataTables)\.js$|test_dump_html_mails.ref.html'` +files=`hg loc '*.py' '*.html' '*.css' '*.rst' '*.txt' '*.js' '*.ini' '*.cfg' CONTRIBUTORS LICENSE.md | egrep -v '/lockfiles.py|LICENSE-MERGELY.html|/codemirror/|/fontello/|(graph|mergely|native.history|select2/select2|yui.flot|yui.2.9|jquery.dataTables)\.js$|/email_templates/|/test_dump_html_mails.ref.html'` sed -i -e "s,`printf '\t'`, ,g" $files sed -i -e "s, *$,,g" $files