aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdocs/changelog.rst10
-rw-r--r--rhodecode/model/notification.py3
-rw-r--r--rhodecode/model/pull_request.py20
-rw-r--r--rhodecode/templates/email_templates/pull_request.html20
4 files changed, 42 insertions, 11 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index e57d859c..cab0914e 100755
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -18,15 +18,17 @@ news
empty data
- modified_on column saves repository update and it's going to be used
later for light version of main page ref #500
+- pull request notifications send much nicer emails with details about pull
+ request
fixes
+++++
- fixed migrations of permissions that can lead to inconsistency.
- Some users sent feedback that after upgrading from older versions issues with updating
- default permissions occured. RhodeCode detects that now and resets default user
- permission to initial state if there is a need for that. Also forces users to set
- the default value for new forking permission.
+ Some users sent feedback that after upgrading from older versions issues
+ with updating default permissions occurred. RhodeCode detects that now and
+ resets default user permission to initial state if there is a need for that.
+ Also forces users to set the default value for new forking permission.
1.4.0 (**2012-09-03**)
diff --git a/rhodecode/model/notification.py b/rhodecode/model/notification.py
index b7df794b..459c622f 100644
--- a/rhodecode/model/notification.py
+++ b/rhodecode/model/notification.py
@@ -255,7 +255,8 @@ class EmailNotificationModel(BaseModel):
self.TYPE_CHANGESET_COMMENT: 'email_templates/changeset_comment.html',
self.TYPE_PASSWORD_RESET: 'email_templates/password_reset.html',
self.TYPE_REGISTRATION: 'email_templates/registration.html',
- self.TYPE_DEFAULT: 'email_templates/default.html'
+ self.TYPE_DEFAULT: 'email_templates/default.html',
+ self.TYPE_PULL_REQUEST: 'email_templates/pull_request.html',
}
def get_email_tmpl(self, type_, **kwargs):
diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py
index 0d136275..8624480f 100644
--- a/rhodecode/model/pull_request.py
+++ b/rhodecode/model/pull_request.py
@@ -79,22 +79,30 @@ class PullRequestModel(BaseModel):
#notification to reviewers
notif = NotificationModel()
+ pr_url = h.url('pullrequest_show', repo_name=other_repo.repo_name,
+ pull_request_id=new.pull_request_id,
+ qualified=True,
+ )
subject = safe_unicode(
h.link_to(
_('%(user)s wants you to review pull request #%(pr_id)s') % \
{'user': created_by_user.username,
'pr_id': new.pull_request_id},
- h.url('pullrequest_show', repo_name=other_repo.repo_name,
- pull_request_id=new.pull_request_id,
- qualified=True,
- )
+ pr_url
)
)
body = description
+ kwargs = {
+ 'pr_title': title,
+ 'pr_user_created': h.person(created_by_user.email),
+ 'pr_repo_url': h.url('summary_home', repo_name=other_repo.repo_name,
+ qualified=True,),
+ 'pr_url': pr_url,
+ 'pr_revisions': revisions
+ }
notif.create(created_by=created_by_user, subject=subject, body=body,
recipients=reviewers,
- type_=Notification.TYPE_PULL_REQUEST,)
-
+ type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
return new
def update_reviewers(self, pull_request, reviewers_ids):
diff --git a/rhodecode/templates/email_templates/pull_request.html b/rhodecode/templates/email_templates/pull_request.html
new file mode 100644
index 00000000..bc13dc94
--- /dev/null
+++ b/rhodecode/templates/email_templates/pull_request.html
@@ -0,0 +1,20 @@
+## -*- coding: utf-8 -*-
+<%inherit file="main.html"/>
+
+User <b>${pr_user_created}</b> opened pull request for repository
+${pr_repo_url} and wants you to review changes.
+
+<div>title: ${pr_title}</div>
+<div>description:</div>
+<p>
+${body}
+</p>
+
+<div>revisions for reviewing</div>
+<ul>
+%for r in pr_revisions:
+ <li>${r}</li>
+%endfor
+</ul>
+
+View this pull request here: ${pr_url}