changeset 6135:8b75085c2c02

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
author Mads Kiilerich <madski@unity3d.com>
date Thu, 28 Jul 2016 16:44:24 +0200
parents 8bd957e6cccb
children c82f90f4fc19
files kallithea/model/comment.py kallithea/model/user.py kallithea/templates/email_templates/button.html kallithea/templates/email_templates/button.txt kallithea/templates/email_templates/changeset_comment.html kallithea/templates/email_templates/changeset_comment.txt kallithea/templates/email_templates/comment.html kallithea/templates/email_templates/comment.txt kallithea/templates/email_templates/default.html kallithea/templates/email_templates/default.txt kallithea/templates/email_templates/header.html kallithea/templates/email_templates/header.txt kallithea/templates/email_templates/main.html kallithea/templates/email_templates/main.txt kallithea/templates/email_templates/password_reset.html kallithea/templates/email_templates/password_reset.txt kallithea/templates/email_templates/pull_request.html kallithea/templates/email_templates/pull_request.txt kallithea/templates/email_templates/pull_request_comment.html kallithea/templates/email_templates/pull_request_comment.txt kallithea/templates/email_templates/registration.html kallithea/templates/email_templates/registration.txt kallithea/tests/models/test_dump_html_mails.ref.html kallithea/tests/models/test_notifications.py scripts/whitespacecleanup.sh
diffstat 25 files changed, 911 insertions(+), 533 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/comment.py	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/model/comment.py	Thu Jul 28 16:44:24 2016 +0200
@@ -88,6 +88,7 @@
                 '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 @@
                 '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),
--- a/kallithea/model/user.py	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/model/user.py	Thu Jul 28 16:44:24 2016 +0200
@@ -198,7 +198,9 @@
         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,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/button.html	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,8 @@
+<%page args="url,title='',padding_top=True,padding_bottom=True" />\
+##<!-- button -->
+<p>
+            <a href="${url}" target="_blank">
+                        ${_(title)}
+            </a>
+</p>
+##<!-- /button -->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/button.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,3 @@
+<%page args="url,title" />\
+
+${title|n,unicode}: ${url}
--- a/kallithea/templates/email_templates/changeset_comment.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/changeset_comment.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,20 +1,19 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-%if is_mention:
-<p>${_('Comment from %s on %s changeset %s mentioned you') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))}:</p>
-%else:
-<p>${_('Comment from %s on %s changeset %s') % (cs_comment_user, cs_target_repo, h.short_id(raw_id))}:</p>
-%endif
-<p>${body}</p>
-
-%if status_change:
-    <p>${_('The changeset status was changed to')}: <b>${status_change}</b></p>
-%endif
-
-<p>${_('URL')}: <a href="${cs_comment_url}">${cs_comment_url}</a></p>
-
-<p>${_('Changeset')}: ${h.short_id(raw_id)}</p>
-<p>${_('Description')}:<br/>
-${h.shorter(message, 256)}
-</p>
+<%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"/>\
+</%block>\
+\
+<%include file="comment.html" args="text=body,author=cs_comment_user,status=status_change"/>\
+            <p>
+                ${_('Changeset on')}
+                <a href="${cs_target_repo}">${cs_target_repo}</a>
+                ${_('branch')}
+                ${branch}:
+                <br/>
+                "<a href="${cs_url}">${h.shorter(message, 60, firstline=True)}</a>"
+                ${_('by')}
+                ${cs_author.full_name_and_username}.
+            </p>
+<%include file="button.html" args="url=cs_comment_url,title=_('View Comment'),padding_bottom=False"/>\
--- a/kallithea/templates/email_templates/changeset_comment.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/changeset_comment.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -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"/>\
+</%block>\
 
-%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')"/>\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/comment.html	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,17 @@
+<%page args="author,text,status,close=False" />\
+\
+##<!-- comment ->
+            <h2>${author}</h2>
+                %if status:
+                    <p>
+                        ${_('Status change:')}
+                        ${status}
+                    </p>
+                %endif
+                %if close:
+                    <p>
+                        ${_('The pull request has been closed.')}
+                    </p>
+                %endif
+                <div style="font-family:monospace;white-space:pre-wrap">${text}</div>
+##<!-- /comment ->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/comment.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,15 @@
+<%page args="author,text,status,close=False" />\
+${author|n,unicode}:
+
+%if status:
+${_('Status change:')|n,unicode} \
+${status|n,unicode}
+
+%endif
+%if close:
+${_('The pull request has been closed.')|n,unicode}
+
+%endif
+${text|n,unicode}
+
+## Trailing empty line
--- a/kallithea/templates/email_templates/default.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/default.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,4 +1,7 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-${body}
+<%inherit file="main.html"/>\
+\
+<%block name="header">\
+<%include file="header.html" args="title=_('Message'),link=None"/>\
+</%block>\
+\
+        <div style="font-family:monospace;white-space:pre-wrap">${body}</div>
--- a/kallithea/templates/email_templates/default.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/default.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -1,4 +1,4 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.txt"/>
-
-${body|n,unicode}
+<%block name="header">\
+</%block>\
+\
+${body|n,unicode}\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/header.html	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,12 @@
+<%page args="title,link" />\
+\
+##<!-- header -->
+    <h1>
+        %if link is not None:
+            <a href="${link}"
+               target="_blank">${title}</a>
+        %else:
+            ${title}
+        %endif
+    </h1>
+##<!-- /header -->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kallithea/templates/email_templates/header.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -0,0 +1,8 @@
+<%page args="title,link" />\
+%if link is not None:
+${link}
+
+%endif
+${title|n,unicode}
+
+## Trailing empty line
--- a/kallithea/templates/email_templates/main.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/main.html	Thu Jul 28 16:44:24 2016 +0200
@@ -6,10 +6,8 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 </head>
 <body>
-${self.body()}
-<br/>
-<br/>
--- <br/>
-${_("This is an automatic notification. Don't reply to this mail.")}
+                        ##<!-- body -->
+${self.body()}\
+                        ##<!-- /body -->
 </body>
 </html>
--- a/kallithea/templates/email_templates/main.txt	Thu Jul 28 16:36:51 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-${self.body()|n,unicode}
-
--- 
-${_("This is an automatic notification. Don't reply to this mail.")|n,unicode}
--- a/kallithea/templates/email_templates/password_reset.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/password_reset.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,16 +1,26 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-<h4>${_('Hello %s') % user}</h4>
+<%inherit file="main.html"/>\
+\
+<%block name="header">\
+<%include file="header.html" args="title=_('Password Reset Request'),link=None"/>\
+</%block>\
+\
+            <h2>${_('Hello %s') % user},</h2>
+            <p>
+                ${_('We have received a request to reset the password for your account.')}
+            </p>
+            <p>
 
-<p>${_('We have received a request to reset the password for your account.')}</p>
-%if reset_token is None:
-<p>${_('This account is however managed outside this system and the password cannot be changed here.')}</p>
-%else:
-<p>${_('To set a new password, click the following link')}:</p>
-<p><a href="${reset_url}">${reset_url}</a></p>
-
-<p>${_("Should you not be able to use the link above, please type the following code into the password reset form")}: <code>${reset_token}</code></p>
-%endif
-
-<p>${_("If it weren't you who requested the password reset, just disregard this message.")}</p>
+            %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')}:
+                    <br/>
+                    <a href="${reset_url}"
+                        target="_blank">${reset_url}</a>
+                    <br/>
+                    ${_("Should you not be able to use the link above, please type the following code into the password reset form")}:
+                    <code>${reset_token}</code>
+            %endif
+            <p>
+                ${_("If it weren't you who requested the password reset, just disregard this message.")}
+            </p>
--- a/kallithea/templates/email_templates/password_reset.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/password_reset.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -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"/>\
+</%block>\
+\
+${_('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 @@
 
 ${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}
--- a/kallithea/templates/email_templates/pull_request.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/pull_request.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,22 +1,37 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-%if is_mention:
-<p>${_('%s mentioned you on %s pull request "%s"') % (pr_user_created, repo_name, pr_title)}</p>
-%else:
-<p>${_('%s requested your review of %s pull request "%s"') % (pr_user_created, repo_name, pr_title)}</p>
-%endif
-
-<p>${_('URL')}: <a href="${pr_url}">${pr_url}</a></p>
-
-<p>${_('Description')}:</p>
-<p style="white-space: pre-wrap; font-family: monospace">${body}</p>
-
-<p>${_('Changesets')}:</p>
-<p style="white-space: pre-wrap">
-%for r,r_msg in pr_revisions:
-<i><a href="${h.canonical_url('changeset_home', repo_name=org_repo_name, revision=r)}">${h.short_id(r)}</a></i>:
-${h.shorter(r_msg, 256)}
-
-%endfor
-</p>
+<%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"/>\
+</%block>\
+\
+            <p>
+                ${_('Pull request from')}
+                <a href="${pr_source_repo}">${pr_source_repo}</a>
+                ${_('at')}
+                ${pr_source_branch}
+                ${_('to')}
+                <a href="${pr_target_repo}">${pr_target_repo}</a>
+                ${_('at')}
+                ${pr_target_branch}:
+                <br/>
+                <a href="${pr_url}">${pr_nice_id}</a>
+                "${pr_title}"
+                ${_('by')}
+                ${pr_owner.full_name_and_username}.
+            </p>
+            <p>
+                ${_('Description')}:
+            </p>
+            <div style="font-family:monospace;white-space:pre-wrap">${body}</div>
+            <p>${_('Changesets')}:</p>
+            <ul>
+                %for revision, desc in pr_revisions:
+                    <li>
+                        <a href="${h.canonical_url('changeset_home', repo_name=org_repo_name, revision=revision)}">
+                            ${h.shorter(desc, 80, firstline=True)}
+                        </a>
+                    </li>
+                %endfor
+            </ul>
+<%include file="button.html" args="url=pr_url,title=_('View Pull Request'),padding_bottom=False"/>\
--- a/kallithea/templates/email_templates/pull_request.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/pull_request.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -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"/>\
+</%block>\
 
-%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'"/>\
--- a/kallithea/templates/email_templates/pull_request_comment.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/pull_request_comment.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,15 +1,24 @@
-## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-<p>${_('Comment from %s on %s pull request "%s"') % (pr_comment_user, repo_name, pr_title)}:</p>
-<p>${body}</p>
-
-%if status_change:
-    %if closing_pr:
-       <p>${_('The comment closed the pull request with status')}: <b>${status_change}</b></p>
-    %else:
-       <p>${_('The comment was made with status')}: <b>${status_change}</b></p>
-    %endif
-%endif
-
-<p>${_('URL')}: <a href="${pr_comment_url}">${pr_comment_url}</a></p>
+<%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"/>\
+</%block>\
+\
+<%include file="comment.html" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\
+            <p>
+                ${_('Pull request from')}
+                <a href="${pr_source_repo}">${pr_source_repo}</a>
+                ${_('at')}
+                ${pr_source_branch}
+                ${_('to')}
+                <a href="${pr_target_repo}">${pr_target_repo}</a>
+                ${_('at')}
+                ${pr_target_branch}:
+                <br/>
+                <a href="${pr_url}">${pr_nice_id}</a>
+                "${pr_title}"
+                ${_('by')}
+                ${pr_owner.full_name_and_username}.
+            </p>
+<%include file="button.html" args="url=pr_comment_url,title=_('View Comment'),padding_bottom=False"/>\
--- a/kallithea/templates/email_templates/pull_request_comment.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/pull_request_comment.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -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"/>\
+</%block>\
 
-${_('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')"/>\
--- a/kallithea/templates/email_templates/registration.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/registration.html	Thu Jul 28 16:44:24 2016 +0200
@@ -1,6 +1,23 @@
 ## -*- coding: utf-8 -*-
-<%inherit file="main.html"/>
-
-${body}
-
-${_('View this user here')}: <a href="${registered_user_url}">${registered_user_url}</a>
+<%inherit file="main.html"/>\
+\
+<%block name="header">\
+<%include file="header.html" args="title=_('New User Registration'),link=registered_user_url"/>\
+</%block>\
+\
+        <p>
+            ${_('Username')}:
+            <br/>
+            ${new_username}
+        </p>
+        <p>
+            ${_('Full Name')}:
+            <br/>
+            ${new_full_name}
+        </p>
+        <p>
+            ${_('Email')}:
+            <br/>
+            ${new_email}
+        </p>
+<%include file="button.html" args="url=registered_user_url,title=_('View User Profile'),padding_bottom=False"/>\
--- a/kallithea/templates/email_templates/registration.txt	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/templates/email_templates/registration.txt	Thu Jul 28 16:44:24 2016 +0200
@@ -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"/>\
+</%block>\
+
+${_('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'"/>\
--- a/kallithea/tests/models/test_dump_html_mails.ref.html	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/tests/models/test_dump_html_mails.ref.html	Thu Jul 28 16:44:24 2016 +0200
@@ -10,23 +10,23 @@
 Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -37,25 +37,29 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:</p>
-<p><div class="formatted-fixed">This is the new comment.
-
- - and here it ends indented.</div></p>
-
-
-<p>URL: <a href="http://comment.org">http://comment.org</a></p>
+    <h1>
+            <a href="http://comment.org"
+               target="_blank">Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.
 
-<p>Changeset: cafe1234c0ff</p>
-<p>Description:<br/>
-This changeset did something clever which is hard to explain
+ - and here it ends indented.</div></div>
+            <p>
+                Changeset on
+                <a href="repo_target">repo_target</a>
+                branch
+                brunch:
+                <br/>
+                "<a href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://comment.org" target="_blank">
+                        View Comment
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -67,23 +71,23 @@
 Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -94,25 +98,29 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:</p>
-<p><div class="formatted-fixed">This is the new comment.
-
- - and here it ends indented.</div></p>
-
-
-<p>URL: <a href="http://comment.org">http://comment.org</a></p>
+    <h1>
+            <a href="http://comment.org"
+               target="_blank">Mention in Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.
 
-<p>Changeset: cafe1234c0ff</p>
-<p>Description:<br/>
-This changeset did something clever which is hard to explain
+ - and here it ends indented.</div></div>
+            <p>
+                Changeset on
+                <a href="repo_target">repo_target</a>
+                branch
+                brunch:
+                <br/>
+                "<a href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://comment.org" target="_blank">
+                        View Comment
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -124,24 +132,25 @@
 Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -152,26 +161,33 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff:</p>
-<p><div class="formatted-fixed">This is the new comment.
-
- - and here it ends indented.</div></p>
-
-    <p>The changeset status was changed to: <b>Approved</b></p>
+    <h1>
+            <a href="http://comment.org"
+               target="_blank">Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Approved
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.
 
-<p>URL: <a href="http://comment.org">http://comment.org</a></p>
-
-<p>Changeset: cafe1234c0ff</p>
-<p>Description:<br/>
-This changeset did something clever which is hard to explain
+ - and here it ends indented.</div></div>
+            <p>
+                Changeset on
+                <a href="repo_target">repo_target</a>
+                branch
+                brunch:
+                <br/>
+                "<a href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://comment.org" target="_blank">
+                        View Comment
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -183,24 +199,25 @@
 Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -211,26 +228,33 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo_target changeset cafe1234c0ff mentioned you:</p>
-<p><div class="formatted-fixed">This is the new comment.
-
- - and here it ends indented.</div></p>
-
-    <p>The changeset status was changed to: <b>Approved</b></p>
+    <h1>
+            <a href="http://comment.org"
+               target="_blank">Mention in Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Approved
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.
 
-<p>URL: <a href="http://comment.org">http://comment.org</a></p>
-
-<p>Changeset: cafe1234c0ff</p>
-<p>Description:<br/>
-This changeset did something clever which is hard to explain
+ - and here it ends indented.</div></div>
+            <p>
+                Changeset on
+                <a href="repo_target">repo_target</a>
+                branch
+                brunch:
+                <br/>
+                "<a href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://comment.org" target="_blank">
+                        View Comment
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -242,15 +266,8 @@
 Subject: Test Message
 </pre>
 <hr/>
-<pre>
-
-This is the body of the test message
- - nothing interesting here except indentation.
-
-
--- 
-This is an automatic notification. Don't reply to this mail.
-</pre>
+<pre>This is the body of the test message
+ - nothing interesting here except indentation.</pre>
 <hr/>
 <!--!doctype html-->
 <!--html lang="en"-->
@@ -260,15 +277,11 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<div class="formatted-fixed">This is the body of the test message
- - nothing interesting here except indentation.</div>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+    <h1>
+            Message
+    </h1>
+        <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the body of the test message
+ - nothing interesting here except indentation.</div></div>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -280,15 +293,19 @@
 Subject: New user newbie registered
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -299,16 +316,30 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<div class="formatted-fixed">Registration body</div>
-
-View this user here: <a href="http://newbie.org">http://newbie.org</a>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+    <h1>
+            <a href="http://newbie.org"
+               target="_blank">New User Registration</a>
+    </h1>
+        <p>
+            Username:
+            <br/>
+            newbie
+        </p>
+        <p>
+            Full Name:
+            <br/>
+            New Full Name
+        </p>
+        <p>
+            Email:
+            <br/>
+            new@email.com
+        </p>
+<p>
+            <a href="http://newbie.org" target="_blank">
+                        View User Profile
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -320,29 +351,28 @@
 Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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&amp;revision=123abc123abc123abc123abc123abc123abc123abc
-Introduce one and two
 
-and that's it
+Changesets:
 
-567fed567fed: http://changeset_home/?repo_name=repo_org&amp;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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -353,32 +383,48 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Requesting User (root) requested your review of repo/name pull request &#34;The Title&#34;</p>
-
-<p>URL: <a href="http://pr.org/7">http://pr.org/7</a></p>
-
-<p>Description:</p>
-<p style="white-space: pre-wrap; font-family: monospace"><div class="formatted-fixed">This PR is awesome because it does stuff
- - please approve indented!</div></p>
-
-<p>Changesets:</p>
-<p style="white-space: pre-wrap">
-<i><a href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">123abc123abc</a></i>:
-Introduce one and two
-
-and that&#39;s it
-
-<i><a href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">567fed567fed</a></i>:
-Make one plus two equal tree
-
+    <h1>
+            <a href="http://pr.org/7"
+               target="_blank">Added as Reviewer of Pull Request #7 &#34;The Title&#34; by Requesting User (root)</a>
+    </h1>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+            <p>
+                Description:
+            </p>
+            <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This PR is awesome because it does stuff
+ - please approve indented!</div></div>
+            <p>Changesets:</p>
+            <ul>
+                    <li>
+                        <a href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">
+                            Introduce one and two
+                        </a>
+                    </li>
+                    <li>
+                        <a href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">
+                            Make one plus two equal tree
+                        </a>
+                    </li>
+            </ul>
+<p>
+            <a href="http://pr.org/7" target="_blank">
+                        View Pull Request
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -390,29 +436,28 @@
 Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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&amp;revision=123abc123abc123abc123abc123abc123abc123abc
-Introduce one and two
 
-and that's it
+Changesets:
 
-567fed567fed: http://changeset_home/?repo_name=repo_org&amp;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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -423,32 +468,48 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Requesting User (root) mentioned you on repo/name pull request &#34;The Title&#34;</p>
-
-<p>URL: <a href="http://pr.org/7">http://pr.org/7</a></p>
-
-<p>Description:</p>
-<p style="white-space: pre-wrap; font-family: monospace"><div class="formatted-fixed">This PR is awesome because it does stuff
- - please approve indented!</div></p>
-
-<p>Changesets:</p>
-<p style="white-space: pre-wrap">
-<i><a href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">123abc123abc</a></i>:
-Introduce one and two
-
-and that&#39;s it
-
-<i><a href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">567fed567fed</a></i>:
-Make one plus two equal tree
-
+    <h1>
+            <a href="http://pr.org/7"
+               target="_blank">Mention on Pull Request #7 &#34;The Title&#34; by Requesting User (root)</a>
+    </h1>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+            <p>
+                Description:
+            </p>
+            <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">This PR is awesome because it does stuff
+ - please approve indented!</div></div>
+            <p>Changesets:</p>
+            <ul>
+                    <li>
+                        <a href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">
+                            Introduce one and two
+                        </a>
+                    </li>
+                    <li>
+                        <a href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">
+                            Make one plus two equal tree
+                        </a>
+                    </li>
+            </ul>
+<p>
+            <a href="http://pr.org/7" target="_blank">
+                        View Pull Request
+            </a>
 </p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -460,19 +521,23 @@
 Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -483,20 +548,34 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -508,19 +587,23 @@
 Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -531,20 +614,34 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Mention in Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -556,20 +653,25 @@
 Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -580,21 +682,38 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Under Review
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-       <p>The comment was made with status: <b>Under Review</b></p>
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -606,20 +725,25 @@
 Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -630,21 +754,38 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Mention in Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Under Review
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-       <p>The comment was made with status: <b>Under Review</b></p>
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -656,19 +797,25 @@
 Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -679,20 +826,37 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Pull Request #7 &#34;The Title&#34; Closed</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        The pull request has been closed.
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -704,19 +868,25 @@
 Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -727,20 +897,37 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Mention in Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        The pull request has been closed.
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -752,20 +939,27 @@
 Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -776,21 +970,41 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Pull Request #7 &#34;The Title&#34; Closed</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Under Review
+                    </p>
+                    <p>
+                        The pull request has been closed.
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-       <p>The comment closed the pull request with status: <b>Under Review</b></p>
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -802,20 +1016,27 @@
 Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 </pre>
 <hr/>
-<pre>
+<pre>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
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -826,21 +1047,41 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<p>Comment from Opinionated User (jsmith) on repo/name pull request &#34;The Title&#34;:</p>
-<p><div class="formatted-fixed">Me too!
-
- - and indented on second line</div></p>
+    <h1>
+            <a href="http://pr.org/comment"
+               target="_blank">Mention in Comment on Pull Request #7 &#34;The Title&#34;</a>
+    </h1>
+            <h2>Opinionated User (jsmith)</h2>
+                    <p>
+                        Status change:
+                        Under Review
+                    </p>
+                    <p>
+                        The pull request has been closed.
+                    </p>
+                <div style="font-family:monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!
 
-       <p>The comment closed the pull request with status: <b>Under Review</b></p>
-
-<p>URL: <a href="http://pr.org/comment">http://pr.org/comment</a></p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+ - and indented on second line</div></div>
+            <p>
+                Pull request from
+                <a href="https://dev.org/repo">https://dev.org/repo</a>
+                at
+                devbranch
+                to
+                <a href="http://mainline.com/repo">http://mainline.com/repo</a>
+                at
+                trunk:
+                <br/>
+                <a href="http://pr.org/7">#7</a>
+                "The Title"
+                by
+                u2 u3 (u2).
+            </p>
+<p>
+            <a href="http://pr.org/comment" target="_blank">
+                        View Comment
+            </a>
+</p>
 <!--/body-->
 <!--/html-->
 <hr/>
@@ -852,22 +1093,20 @@
 Subject: Password reset link
 </pre>
 <hr/>
-<pre>
+<pre>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.
 </pre>
 <hr/>
 <!--!doctype html-->
@@ -878,22 +1117,25 @@
     <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 <!--/head-->
 <!--body-->
-
-
-<h4>Hello John Doe</h4>
-
-<p>We have received a request to reset the password for your account.</p>
-<p>To set a new password, click the following link:</p>
-<p><a href="http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746">http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746</a></p>
+    <h1>
+            Password Reset Request
+    </h1>
+            <h2>Hello John Doe,</h2>
+            <p>
+                We have received a request to reset the password for your account.
+            </p>
+            <p>
 
-<p>Should you not be able to use the link above, please type the following code into the password reset form: <code>decbf64715098db5b0bd23eab44bd792670ab746</code></p>
-
-<p>If it weren&#39;t you who requested the password reset, just disregard this message.</p>
-
-<br/>
-<br/>
--- <br/>
-This is an automatic notification. Don&#39;t reply to this mail.
+                    To set a new password, click the following link:
+                    <br/>
+                    <a href="http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746"
+                        target="_blank">http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746</a>
+                    <br/>
+                    Should you not be able to use the link above, please type the following code into the password reset form:
+                    <code>decbf64715098db5b0bd23eab44bd792670ab746</code>
+            <p>
+                If it weren&#39;t you who requested the password reset, just disregard this message.
+            </p>
 <!--/body-->
 <!--/html-->
 <hr/>
--- a/kallithea/tests/models/test_notifications.py	Thu Jul 28 16:36:51 2016 +0200
+++ b/kallithea/tests/models/test_notifications.py	Thu Jul 28 16:44:24 2016 +0200
@@ -49,7 +49,7 @@
         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):
--- a/scripts/whitespacecleanup.sh	Thu Jul 28 16:36:51 2016 +0200
+++ b/scripts/whitespacecleanup.sh	Thu Jul 28 16:44:24 2016 +0200
@@ -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