SciPost Code Repository

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

add reinvitation mail button for nominees

parent 0ca99114
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@
{% else %}
<span class="text-success">{% include 'bi/check-square-fill.html' %}</span>
<span>&nbsp;This nominee has been invited to serve as a Fellow.</span>
<a class="btn btn-sm btn-secondary"
href="{% url 'colleges:fellowship_invitation_email_reminder' pk=invitation.id %}">Reinvite</a>
{% endif %}
</li>
......
......@@ -291,6 +291,11 @@ urlpatterns = [
views.FellowshipInvitationEmailInitialView.as_view(),
name="fellowship_invitation_email_initial",
),
path(
"fellowship_invitation/<int:pk>/email_reminder",
views.FellowshipInvitationEmailReminderView.as_view(),
name="fellowship_invitation_email_reminder",
),
path(
"_hx_fellowship_invitation/<int:invitation_id>/update_response",
views._hx_fellowship_invitation_update_response,
......
......@@ -1069,6 +1069,26 @@ class FellowshipInvitationEmailInitialView(PermissionsMixin, MailView):
return super().form_valid(form)
class FellowshipInvitationEmailReminderView(PermissionsMixin, MailView):
"""Send a templated email to an elected nominee to remind them of the invitation."""
permission_required = "scipost.can_manage_college_composition"
queryset = FellowshipInvitation.objects.all()
mail_code = "fellowship_nominees/fellowship_invitation_reminder"
success_url = reverse_lazy("colleges:nominations")
def form_valid(self, form):
"""Create an event associated to this outgoing email."""
self.object.nomination.add_event(
description="Invitation reminder email sent",
by=self.request.user.contributor,
)
self.object.invited_on = timezone.now()
self.object.response = FellowshipInvitation.RESPONSE_REINVITED
self.object.save()
return super().form_valid(form)
@login_required
@user_passes_test(is_edadmin)
def _hx_fellowship_invitation_update_response(request, invitation_id):
......
<p>Dear {{ object.nomination.profile.get_title_display }} {{ object.nomination.profile.last_name }},</p>
<p>
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>
<p>Sincerely,</p>
<p>
Prof. J.-S. Caux,
<br />
on behalf of the SciPost Foundation
</p>
<hr />
{% include "email/fellowship_nominees/fellowship_invitation_initial.html" %}
{
"subject": "Reminder: Invitation to become a Fellow at SciPost",
"recipient_list": [
"nomination.profile.email",
"nomination.profile.contributor.user.email|None"
],
"bcc": [
"edadmin@"
],
"from_name": "SciPost EdAdmin",
"from_email": "edadmin@"
}
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