SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit a77c53d3 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add registration invitation to nominated fellow emails

parent 346af38c
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,9 @@ from colleges.permissions import (
is_edadmin_or_advisory_or_active_regular_or_senior_fellow,
)
from colleges.utils import check_profile_eligibility_for_fellowship
from invitations.constants import INVITATION_EDITORIAL_FELLOW
from invitations.models import RegistrationInvitation
from scipost.constants import TITLE_DR
from scipost.permissions import HTMXPermissionsDenied, HTMXResponse
from submissions.models import Submission
......@@ -1057,6 +1060,27 @@ class FellowshipInvitationEmailInitialView(PermissionsMixin, MailView):
mail_code = "fellowship_nominees/fellowship_invitation_initial"
success_url = reverse_lazy("colleges:nominations")
def get_mail_config(self):
config = super().get_mail_config()
profile = self.object.nomination.profile
(
registration_invitation,
reginv_created,
) = RegistrationInvitation.objects.get_or_create(
profile=profile,
title=profile.title if profile.title else TITLE_DR,
first_name=profile.first_name,
last_name=profile.last_name,
email=profile.email,
created_by=self.request.user,
invited_by=self.request.user,
invitation_type=INVITATION_EDITORIAL_FELLOW,
)
self.reg_inv = registration_invitation
config["registration_invitation"] = registration_invitation
return config
def form_valid(self, form):
"""Create an event associated to this outgoing email."""
self.object.nomination.add_event(
......@@ -1066,6 +1090,10 @@ class FellowshipInvitationEmailInitialView(PermissionsMixin, MailView):
self.object.invited_on = timezone.now()
self.object.response = FellowshipInvitation.RESPONSE_INVITED
self.object.save()
# run actions on successful invitation sent
self.reg_inv.mail_sent()
return super().form_valid(form)
......@@ -1077,6 +1105,27 @@ class FellowshipInvitationEmailReminderView(PermissionsMixin, MailView):
mail_code = "fellowship_nominees/fellowship_invitation_reminder"
success_url = reverse_lazy("colleges:nominations")
def get_mail_config(self):
config = super().get_mail_config()
profile = self.object.nomination.profile
(
registration_invitation,
reginv_created,
) = RegistrationInvitation.objects.get_or_create(
profile=profile,
title=profile.title if profile.title else TITLE_DR,
first_name=profile.first_name,
last_name=profile.last_name,
email=profile.email,
created_by=self.request.user,
invited_by=self.request.user,
invitation_type=INVITATION_EDITORIAL_FELLOW,
)
self.reg_inv = registration_invitation
config["registration_invitation"] = registration_invitation
return config
def form_valid(self, form):
"""Create an event associated to this outgoing email."""
self.object.nomination.add_event(
......@@ -1086,6 +1135,10 @@ class FellowshipInvitationEmailReminderView(PermissionsMixin, MailView):
self.object.invited_on = timezone.now()
self.object.response = FellowshipInvitation.RESPONSE_REINVITED
self.object.save()
# run actions on successful invitation sent
self.reg_inv.mail_sent()
return super().form_valid(form)
......
<p>Dear {{ object.nomination.profile.get_title_display }} {{ object.nomination.profile.last_name }},</p>
<p>
We are sending you this email to formally invite you to join <a href="https://scipost.org">SciPost</a>'s Editorial College in {{ object.nomination.college.name }}.
We are sending you this email to formally invite you to join <a href="https://{{ domain }}/">SciPost</a>'s Editorial College in {{ object.nomination.college.name }}.
</p>
<p>
For the past several years, the SciPost Foundation has built a community-run, open and not-for-profit infrastructure for scientific publishing (see our <a href="https://scipost.org/about">about page</a> for a quick introduction or reminder). We are grateful for the positive reception that our journals enjoyed and look forward to strengthening our Editorial Colleges with prominent members of the scientific community. As mentioned above, on behalf of the SciPost Foundation and in light of your professional expertise and reputation, we hereby would like to invite you to join the Editorial College (Physics) by becoming one of our Editorial Fellows.
For the past several years, the SciPost Foundation has built a community-run, open and not-for-profit infrastructure for scientific publishing (see our <a href="https://{{ domain }}//about">about page</a> for a quick introduction or reminder). We are grateful for the positive reception that our journals enjoyed and look forward to strengthening our Editorial Colleges with prominent members of the scientific community. As mentioned above, on behalf of the SciPost Foundation and in light of your professional expertise and reputation, we hereby would like to invite you to join the Editorial College (Physics) by becoming one of our Editorial Fellows.
</p>
<p>
Academic excellence is the most important criterion guiding our considerations of who should belong to our Editorial Colleges. The current list of Colleges and their Fellows can be found <a href="https://scipost.org/colleges/">at this page</a>.
Academic excellence is the most important criterion guiding our considerations of who should belong to our Editorial Colleges. The current list of Colleges and their Fellows can be found <a href="https://{{ domain }}//colleges/">at this page</a>.
</p>
<p>
Participation in the College typically takes a couple hours a week. We ask Fellows to share the workload equitably and to take charge of at least 4 submissions per year. However, you will always remain in control of your level of commitment and of which submissions you take charge of. Functioning of the Colleges proceeds according to the <a href="https://scipost.org/EdCol_by-laws">by-laws</a>, and a short summary of the editorial workflow can be found <a href="https://scipost.org/submissions/editorial_workflow">at this page</a>.
Participation in the College typically takes a couple hours a week. We ask Fellows to share the workload equitably and to take charge of at least 4 submissions per year. However, you will always remain in control of your level of commitment and of which submissions you take charge of. Functioning of the Colleges proceeds according to the <a href="https://{{ domain }}//EdCol_by-laws">by-laws</a>, and a short summary of the editorial workflow can be found <a href="https://{{ domain }}//submissions/editorial_workflow">at this page</a>.
</p>
<p>
We would be very happy to provide you with more information should you require it. Could we kindly ask you to give us a response (by replying to this email) within the next couple of weeks?
</p>
{% if not object.nomination.profile.contributor %}
<p>
Additionally, regardless of your response, we would like to cordially invite you to become a SciPost Contributor by registering on our website. This will allow you to submit your own articles, deliver reports, comment on articles, and perform all duties as Fellow should you also accept that role. For your convenience, we have prepared a pre-filled <a href="https://{{ domain }}/invitation/{{ registration_invitation.invitation_key }}">registration form</a> for you.
</p>
{% endif %}
<p>Many thanks in advance,</p>
<p>
Prof. J.-S. Caux,
......
......@@ -4,6 +4,12 @@
Recently, we contacted you concerning our invitation to join <a href="https://scipost.org">SciPost</a>'s Editorial College in {{ object.nomination.college.name }}. With this email, we would simply like to reiterate this invitation, and inquire about your interest in joining our initiative. Please see below for more details.
</p>
{% if not object.nomination.profile.contributor %}
<p>
Please also use the newly-generated pre-filled <a href="https://{{ domain }}/invitation/{{ registration_invitation.invitation_key }}">registration form</a> if you choose to sign up as a SciPost Contributor.
</p>
{% endif %}
<p>Sincerely,</p>
<p>
Prof. J.-S. Caux,
......
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