You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by sh...@apache.org on 2019/07/21 16:53:29 UTC
[allura] branch ss/8284 updated: [#8284] Improve artifact link
details in email
This is an automated email from the ASF dual-hosted git repository.
shalithasuranga pushed a commit to branch ss/8284
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/ss/8284 by this push:
new ce45893 [#8284] Improve artifact link details in email
ce45893 is described below
commit ce458930bfd96f3fb93814b9b1f2d8f0b68cc653
Author: Shalitha Suranga <sh...@gmail.com>
AuthorDate: Sun Jul 21 22:22:55 2019 +0530
[#8284] Improve artifact link details in email
---
Allura/allura/model/auth.py | 10 ++++++----
Allura/allura/templates/mail/usermentions_email.md | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 459c375..0ce70cf 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -458,14 +458,16 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
tmpl = g.jinja2_env.get_template('allura:templates/mail/usermentions_email.md')
subject = '[%s:%s] Your name was mentioned' % (
c.project.shortname, c.app.config.options.mount_point)
+ item_url = artifact.url()
+ if artifact.type_s == 'Post':
+ item_url = artifact.url_paginated()
tmpl_context = {
'site_domain': config['domain'],
'base_url': config['base_url'],
'user': c.user,
- 'artifact_link': h.absurl(artifact.url()),
- 'mentioned_by': mentioned_by,
- 'project_name': c.project.shortname,
- 'mount_point': c.app.config.options.mount_point
+ 'artifact_link': h.absurl(item_url),
+ 'artifact_linktext': artifact.link_text(),
+ 'mentioned_by': mentioned_by
}
allura.tasks.mail_tasks.sendsimplemail.post(
toaddr=self.get_pref('email_address'),
diff --git a/Allura/allura/templates/mail/usermentions_email.md b/Allura/allura/templates/mail/usermentions_email.md
index 886f16f..02898ca 100644
--- a/Allura/allura/templates/mail/usermentions_email.md
+++ b/Allura/allura/templates/mail/usermentions_email.md
@@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
-#}
-Your name was mentioned at [{{project_name}}:{{mount_point}}]({{artifact_link}}) by {{mentioned_by.display_name}}
+Your name was mentioned at [{{artifact_linktext}}]({{artifact_link}}) by {{mentioned_by.display_name}}
It can be viewed using the link below:
{{artifact_link}}