diff --git a/comments/views.py b/comments/views.py index 0ebf807237dec6debf2be378d9c2dd996b6054da..25ce524ef498821c6d361406cd0c43b4c87f6c80 100644 --- a/comments/views.py +++ b/comments/views.py @@ -46,6 +46,18 @@ def new_comment(request, **kwargs): new_comment.save() new_comment.grant_permissions() + # Mails + mail_sender = DirectMailUtil( + mail_code='commenters/inform_commenter_comment_received', + instance=new_comment) + mail_sender.send() + + if isinstance(new_comment.core_content_object, Submission): + mail_sender = DirectMailUtil( + mail_code='eic/inform_eic_comment_received', + instance=new_comment) + mail_sender.send() + messages.success(request, strings.acknowledge_submit_comment) return redirect(_object.get_absolute_url()) context = {'form': form} diff --git a/templates/email/eic/inform_eic_comment_received.html b/templates/email/eic/inform_eic_comment_received.html index 33ea17ae160c9fd997baa955fa15601eeab4abc5..b4e2c780466369e3196e6478cdb40ee125bd6de4 100644 --- a/templates/email/eic/inform_eic_comment_received.html +++ b/templates/email/eic/inform_eic_comment_received.html @@ -9,7 +9,7 @@ by {{ comment.core_content_object.author_list }}. </p> <p> - Please vet this Comment on <a href="https://scipost.org{% url 'scipost:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a>. + Please vet this Comment on <a href="https://scipost.org{% url 'submissions:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a>. </p> <p> Many thanks in advance for your collaboration,<br> diff --git a/templates/email/eic/inform_eic_comment_received.json b/templates/email/eic/inform_eic_comment_received.json index 0ca12c5ca060b633387661488e8636cb0fd6dd4c..90f695dc362f97df8a00f14d636d9f2de08681ec 100644 --- a/templates/email/eic/inform_eic_comment_received.json +++ b/templates/email/eic/inform_eic_comment_received.json @@ -1,6 +1,6 @@ { "subject": "SciPost: Comment delivered", - "to_address": "comment.core_content_object.editor_in_charge.user.email", + "to_address": "core_content_object.editor_in_charge.user.email", "bcc_to": "edadmin@scipost.org", "from_address_name": "SciPost Refereeing", "from_address": "refereeing@scipost.org",