Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send an email for newly enrolled members #800

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions amelie/members/templates/members/new_member.mail
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% extends "iamailer/email_basic.mail" %}
{% load i18n htmlify only %}

{% block subject %}{% blocktrans %}[Inter-Actief] Welcome to our association{% endblocktrans %}{% endblock %}

{% block content %}{% htmlify %}{% blocktrans %}Dear{% endblocktrans %} {{ recipient.first_name }}

{% blocktrans %}Welcome to {% endblocktrans %}I.C.T.S.V. Inter-{% onlyhtml %}<i>{% endonlyhtml %}Actief{% onlyhtml %}</i>{% endonlyhtml %},{% blocktrans %} the study association for Business Information Technology and Technical Computer Science at the UT! With this mail, we want to give a quick rundown of the various options we offer our members, which are spread over three main points: {% endblocktrans %}

{% endhtmlify %}{% onlyhtml %}<ul>
<li><b>{% translate "Education" %}</b>: {% blocktrans %}Since we are, of course, a study association, we try to assist our members as much as possible with their studies. This includes discounted study book sales, study evenings, and a database of practice exams from previous years. We also help find tutors for members who are looking for one and help amplify feedback and complaints about the study.{% endblocktrans %}</li>
<li><b>{% translate "Career" %}</b>: {% blocktrans %}We also act as a contact point between students and companies. Through activities such as workshops, lunch lectures and an annual symposium, students can get acquainted with the various career options available after their studies. (Or possibly even find a part-time job during their studies!){% endblocktrans %}</li>
<li><b>{% translate "Social" %}</b>: {% blocktrans %}Since it's also important to wind down, we organise many fun activities where you can get to know your fellow students. These range from having casual drinks together every Tuesday to sports activities, trips to other countries, and even a yearly puzzle week.{% endblocktrans %}</li>
</ul>{% endonlyhtml %}
{% onlyplain %} * {% translate "Education" %}: {% blocktrans %}Since we are, of course, a study association, we try to assist our members as much as possible with their studies. This includes discounted study book sales, study evenings, and a database of practice exams from previous years. We also help find tutors for members who are looking for one and help amplify feedback and complaints about the study.{% endblocktrans %}
* {% translate "Career" %}: {% blocktrans %}We also act as a contact point between students and companies. Through activities such as workshops, lunch lectures and an annual symposium, students can get acquainted with the various career options available after their studies. (Or possibly even find a part-time job during their studies!){% endblocktrans %}
* {% translate "Social" %}: {% blocktrans %}Since it's also important to wind down, we organise many fun activities where you can get to know your fellow students. These range from having casual drinks together every Tuesday to sports activities, trips to other countries, and even a yearly puzzle week.{% endblocktrans %}
{% endonlyplain %}{% htmlify %}

{% blocktrans %}Our association is located in the {% endblocktrans %}Inter-{% onlyhtml %}<i>{% endonlyhtml %}Actief{% onlyhtml %}</i>{% endonlyhtml %}{% blocktrans %} room, which can be found on the balcony above Educafé (where the Starbucks is located). Here, the board is present every day and can be approached with any questions or complaints you might have. We also have {% endblocktrans %}{% onlyhtml %}<b>{% endonlyhtml %}{% translate "free coffee/tea" %}{% onlyhtml %}</b>{% endonlyhtml %}{% blocktrans %} and a little 'Cookie Corner', where we sell snacks without a profit margin, and, of course, you can always just come by to relax for a bit. {% endblocktrans %}

{% blocktrans %}We can only provide these services with the help of our active members, who join {% endblocktrans %}{% onlyhtml %}<b>{% endonlyhtml %}{% translate "committees" %}{% onlyhtml %}</b>{% endonlyhtml %}{% blocktrans %} to take care of various tasks in our association, such as organising activities and keeping our systems online. Would you be interested in joining a committee yourself? Then, be sure to check out our committee market! We organise one around the start of the first and third modules, and you can always contact our {% endblocktrans %}{% onlyhtml %}<a href="mailto:[email protected]">{% endonlyhtml %}{% translate "officer of internal affairs" %}{% onlyhtml %}</a>{% endonlyhtml %},{% blocktrans %} to help you find a fun committee that suits you. {% endblocktrans %}

{% blocktrans %}If you have any questions, you can always contact the board through the following channels:{% endblocktrans %}

{% onlyhtml %}<ul><li>{% translate "Telephone" %}: +53 489 3756</li><li>{% translate "Email" %}: <a href="mailto:[email protected]">[email protected]</a></li><li>{% translate "Website" %}: <a href="https://www.inter-actief.utwente.nl/">https://www.inter-actief.utwente.nl/</a></li></ul>{% endonlyhtml %}{% onlyplain %}
* {% translate "Telephone" %}: +53 489 3756
* {% translate "Email" %}: [email protected]
* {% translate "Website" %}: https://www.inter-actief.utwente.nl/
{% endonlyplain %}

{% blocktrans %}If you don’t want to miss out on any {% endblocktrans %}Inter-{% onlyhtml %}<i>{% endonlyhtml %}Actief{% onlyhtml %}</i>{% endonlyhtml %}-{% blocktrans %}related news and announcements, be sure to check out our {% endblocktrans %}{% onlyhtml %}<b>{% endonlyhtml %}{% translate "socials" %}{% onlyhtml %}</b>{% endonlyhtml %}:

{% onlyhtml %}<ul><li>{% blocktrans %}Our WhatsApp community{% endblocktrans %}: <a href="https://ictsv.nl/wa">https://ictsv.nl/wa</a></li><li>{% translate "Discord" %}: <a href="https://ictsv.nl/discord">https://ictsv.nl/discord</a></li><li>{% translate "Instagram" %}: @inter.actief</li><li>{% translate "LinkedIn" %}: <a href="https://www.linkedin.com/company/i.c.t.s.v.-inter-actief/">https://www.linkedin.com/company/i.c.t.s.v.-inter-actief/</a></li></ul>{% endonlyhtml %}{% onlyplain %}
* {% blocktrans %}Our WhatsApp community{% endblocktrans %}: https://ictsv.nl/wa
* {% translate "Discord" %}: https://ictsv.nl/discord
* {% translate "Instagram" %}: @inter.actief
* {% translate "LinkedIn" %}: https://www.linkedin.com/company/i.c.t.s.v.-inter-actief/
{% endonlyplain %}

{% blocktrans %}Hopefully, we’ll see you around soon!{% endblocktrans %}

{% blocktrans %}With kind regards,

The board of {% endblocktrans %}I.C.T.S.V. Inter-{% onlyhtml %}<i>{% endonlyhtml %}Actief{% onlyhtml %}</i>{% endonlyhtml %}{% endhtmlify %}{% endblock %}
27 changes: 27 additions & 0 deletions amelie/members/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from django.views.generic.edit import DeleteView, FormView

from amelie.claudia.models import Mapping, ExtraPerson
from amelie.iamailer import MailTask
from amelie.members.forms import PersonDataForm, StudentNumberForm, \
RegistrationFormPersonalDetails, RegistrationFormStepMemberContactDetails, \
RegistrationFormStepParentsContactDetails, RegistrationFormStepFreshmenStudyDetails, \
Expand All @@ -50,6 +51,7 @@
from amelie.tools.http import HttpResponseSendfile, HttpJSONResponse
from amelie.tools.logic import current_academic_year_with_holidays, current_association_year, association_year
from amelie.tools.mixins import DeleteMessageMixin, RequireBoardMixin, RequireCommitteeMixin
from amelie.tools.mail import PersonRecipient
from amelie.tools.pdf import pdf_separator_page, pdf_membership_page, pdf_authorization_page

@require_board
Expand Down Expand Up @@ -461,7 +463,18 @@ def person_anonymize(request, id, slug):

return render(request, 'person_anonymization_success.html', {'person': person})


def send_new_member_email(person: Person):
"""
Send an email to a new member. This function is used for each type of member.
"""
template_name = "members/new_member.mail"
task = MailTask(template_name=template_name)
task.add_recipient(PersonRecipient(person, context={'membership': person.membership}))

task.send()


class RegisterNewGeneralWizardView(RequireCommitteeMixin, SessionWizardView):
abbreviation = settings.ROOM_DUTY_ABBREVIATION
template_name = "person_registration_form_general.html"
Expand Down Expand Up @@ -571,6 +584,9 @@ def done(self, form_list, **kwargs):
begin=datetime.date(cleaned_data['generation'], 9, 1))
study_period.save()

# Send an email confirming the new enrolment
send_new_member_email(person)

# Render the enrollment forms to PDF for printing
from amelie.tools.pdf import pdf_enrollment_form
buffer = BytesIO()
Expand Down Expand Up @@ -681,6 +697,9 @@ def done(self, form_list, **kwargs):
link_code = get_oauth_link_code(person)
send_oauth_link_code_email(self.request, person, link_code)

# Send an email confirming the new enrolment
send_new_member_email(person)

# Render the enrollment forms to PDF for printing
from amelie.tools.pdf import pdf_enrollment_form
buffer = BytesIO()
Expand Down Expand Up @@ -789,6 +808,9 @@ def done(self, form_list, **kwargs):
employee = Employee(person=person, number=cleaned_data['employee_number'])
employee.save()

# Send an email confirming the new enrolment
send_new_member_email(person)

# Render the enrollment forms to PDF for printing
from amelie.tools.pdf import pdf_enrollment_form
buffer = BytesIO()
Expand Down Expand Up @@ -912,6 +934,9 @@ def done(self, form_list, **kwargs):
dogroup=cleaned_data['dogroup'])
study_period.save()

# Send an email confirming the new enrolment
send_new_member_email(person)

# Render the enrollment forms to PDF for printing
from amelie.tools.pdf import pdf_enrollment_form
buffer = BytesIO()
Expand Down Expand Up @@ -1148,6 +1173,8 @@ def get(self, request, *args, **kwargs):
# Delete the pre-enrollment
pre_enrollment.delete()

send_new_member_email(person)

# Set message
messages.info(self.request, "Pre-registration of {} activated!".format(person.incomplete_name()))

Expand Down
Loading