diff --git a/backend/grant/admin/example_emails.py b/backend/grant/admin/example_emails.py index 998ee592..92c1acb3 100644 --- a/backend/grant/admin/example_emails.py +++ b/backend/grant/admin/example_emails.py @@ -80,7 +80,6 @@ example_email_args = { 'proposal_comment': { 'author': user, 'proposal': proposal, - 'preview': 'Blah blah blah blah blah...', 'comment_url': 'http://somecomment.com', 'author_url': 'http://someuser.com', }, @@ -92,13 +91,11 @@ example_email_args = { 'contribution_update': { 'proposal': proposal, 'proposal_update': update, - 'preview': 'Blah blah blah blah blah blah blah blah blah blah blah blah blah blah...', 'update_url': 'http://someupdate.com', }, 'comment_reply': { 'author': user, 'proposal': proposal, - 'preview': 'Blah blah blah blah blah...', 'comment_url': 'http://somecomment.com', 'author_url': 'http://someuser.com', }, diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index ab71fe11..e4db581d 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -15,7 +15,7 @@ from grant.utils.auth import ( internal_webhook ) from grant.utils.exceptions import ValidationException -from grant.utils.misc import is_email, make_url, from_zat, make_preview +from grant.utils.misc import is_email, make_url, from_zat from grant.utils.enums import ProposalStatus, ContributionStatus from sqlalchemy import or_ @@ -107,13 +107,11 @@ def post_proposal_comments(proposal_id, comment, parent_comment_id): dumped_comment = comment_schema.dump(comment) # TODO: Email proposal team if top-level comment - preview = make_preview(comment.content, 60) if not parent: for member in proposal.team: send_email(member.email_address, 'proposal_comment', { 'author': g.current_user, 'proposal': proposal, - 'preview': preview, 'comment_url': make_url(f'/proposal/{proposal.id}?tab=discussions&comment={comment.id}'), 'author_url': make_url(f'/profile/{comment.author.id}'), }) @@ -122,7 +120,6 @@ def post_proposal_comments(proposal_id, comment, parent_comment_id): send_email(parent.author.email_address, 'comment_reply', { 'author': g.current_user, 'proposal': proposal, - 'preview': preview, 'comment_url': make_url(f'/proposal/{proposal.id}?tab=discussions&comment={comment.id}'), 'author_url': make_url(f'/profile/{comment.author.id}'), }) @@ -328,13 +325,11 @@ def post_proposal_update(proposal_id, title, content): db.session.commit() # Send email to all contributors (even if contribution failed) - preview = make_preview(update.content, 200) contributions = ProposalContribution.query.filter_by(proposal_id=proposal_id).all() for c in contributions: send_email(c.user.email_address, 'contribution_update', { 'proposal': g.current_proposal, 'proposal_update': update, - 'preview': preview, 'update_url': make_url(f'/proposals/{proposal_id}?tab=updates&update={update.id}'), }) diff --git a/backend/grant/templates/emails/comment_reply.html b/backend/grant/templates/emails/comment_reply.html index 8079fb9e..36cb19a5 100644 --- a/backend/grant/templates/emails/comment_reply.html +++ b/backend/grant/templates/emails/comment_reply.html @@ -1,11 +1,7 @@
You just received a reply from {{ args.author.display_name }} - on {{ args.proposal.title }}: -
- -- “{{ args.preview }}” + on {{ args.proposal.title }}.
@@ -17,11 +10,11 @@ |
- View the full update + Read the Update |
Your proposal {{ args.proposal.title }} just received a comment from - {{ args.author.display_name }}: -
- -- “{{ args.preview }}” + {{ args.author.display_name }}.