SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit dec13605 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Add email to report author if sub authors reply to report

parent 83d21b6f
No related branches found
No related tags found
No related merge requests found
......@@ -18,10 +18,11 @@ from .models import Comment
from .forms import CommentForm, VetCommentForm
from .utils import CommentUtils, validate_file_extention
from theses.models import ThesisLink
from commentaries.models import Commentary
from mails.utils import DirectMailUtil
from submissions.utils import SubmissionUtils
from submissions.models import Submission, Report
from commentaries.models import Commentary
from theses.models import ThesisLink
@login_required
......@@ -92,6 +93,12 @@ def vet_submitted_comment(request, comment_id):
# Add events to related Submission and send mail to author of the Submission
content_object.submission.add_event_for_eic('A Comment has been accepted.')
content_object.submission.add_event_for_author('A new Comment has been added.')
if comment.is_author_reply:
# Email Report author: Submission authors have replied
mail_sender = DirectMailUtil(
mail_code='referees/authors_replied_to_report',
instance=content_object)
mail_sender.send()
if not comment.is_author_reply:
SubmissionUtils.load({'submission': content_object.submission})
SubmissionUtils.send_author_comment_received_email()
......
<p>
Dear {{ report.author.get_title_display }} {{ report.user.last_name }},
</p>
<p>
For your information, an Author Reply has been posted on your recent Report on
<br><br>
{{ report.submission.title }}
<br>by {{ report.submission.author_list }}<br>
(see https://scipost.org{{ report.submission.get_absolute_url }} - first submitted {{ report.submission.original_submission_date|date:"d M Y" }}).
</p>
<p>
You can view your Report and the associated reply directly at
<a href="https://scipost.org{{ report.get_absolute_url }}">this link</a>.
</p>
<p>
We thank you very much for your contribution.<br/><br/>The SciPost Team.
</p>
{% include 'email/_footer.html' %}
{
"subject": "SciPost: authors replied to your Report",
"to_address": "author.user.email",
"bcc_to": "submission.editor_in_charge.user.email,admin@scipost.org",
"from_address_name": "SciPost Refereeing",
"from_address": "refereeing@scipost.org",
"context_object": "report"
}
......@@ -4,7 +4,7 @@
<p>
We have received a Submission to SciPost which, in view of your expertise and on behalf of the Editor-in-charge {{invitation.submission.editor_in_charge.get_title_display}} {{invitation.submission.editor_in_charge.user.last_name}}, we would like to invite you to referee:
<br><br>
<a href="https://scipost.org{{invitation.submission.get_absolute_url}}">{{invitation.submission.title}}</a>
{{invitation.submission.title}}
<br>by {{invitation.submission.author_list}}<br>
(see https://scipost.org{{ invitation.submission.get_absolute_url }} - first submitted {{ invitation.submission.original_submission_date|date:"d M Y" }}).
</p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment