Skip to content

Commit

Permalink
Add emails for registration cancel and transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
lket committed Nov 21, 2024
1 parent 1822924 commit a372672
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 27 deletions.
16 changes: 15 additions & 1 deletion resources/yki/localisations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"common.testCentre": "Test centre",
"common.testDay": "Test day",
"common.testFee": "Test fee",
"email.cancel_registration.subject": "Registration for YKI test cancelled",
"email.cancel_registration.content.line1": "Your registration for the following YKI test has been cancelled",
"email.cancel_registration.content.line2": "You test fee will not be refunded automatically.",
"email.cancel_registration.content.line3": "You may apply for a test fee refund from the Finnish National Agency for Education. The Finnish National Agency for Education will refund your test fee if your application meets all the conditions laid down by the Act on National Certificates of Language Proficiency (YKI).",
"email.cancel_registration.content.line4": "If you wish to apply for the test fee refund, read the instructions on the website of the Finnish National Agency for Education:",
"email.cancel_registration.content.line5": "If you have already applied for the test fee refund from the Finnish National Agency for Education, you do not need to resubmit your application.",
"email.cancel_registration.content.line6": "If you have any question, you can contact us at kielitutkinnot@oph.fi.",
"email.cancel_registration.content.link.url": "https://www.oph.fi/en/education-and-qualifications/yki-test#anchor-cancelling-your-test-registration",
"email.cancel_registration.content.link.text": "Cancelling your test registration",
"email.evaluation_payment.content.heading.evaluationFee": "Reassessment fee",
"email.evaluation_payment.content.heading.partialExams": "Subtests",
"email.evaluation_payment.content.orderNumber": "Order number",
Expand Down Expand Up @@ -57,7 +66,7 @@
"email.payment_success.content.line5.link.text": "Cancelling your test registration",
"email.payment_success.content.line5.link.url": "https://www.oph.fi/en/koulutus-ja-tutkinnot/kieli-ja-kaantajatutkinnot/yleiset-kielitutkinnot-yki/ennen-testia#anchor-cancelling-your-test-registration",
"email.payment_success.content.line6": "Please find the payment receipt in the attachments.",
"email.payment_success.extra_information.label": "Additional information from the organizer",
"email.payment_success.extra_information.label": "Additional information from the test centre",
"email.payment_success.idDocument.bulletPoint1": "a passport",
"email.payment_success.idDocument.bulletPoint2": "an identity card",
"email.payment_success.idDocument.bulletPoint3": "an alien's passport",
Expand Down Expand Up @@ -88,6 +97,11 @@
"email.receipt.examPayment.organizer": "Organiser",
"email.receipt.examPayment.title": "Test fee for the National Certificates of Language Proficiency (YKI)",
"email.receipt.examPayment.vatZeroJustification": "The test fees for the National Certificates of Language Proficiency are based on the Ministry of Education and Culture’s Decree on the Fees on the Services Provided by the Finnish National Agency for Education (1223/2022). The fees are exempted from VAT.",
"email.transfer_confirmation.subject": "Registration for YKI test rescheduled",
"email.transfer_confirmation.content.line1": "You may reschedule your registration once. Your registration has been rescheduled for the following YKI test",
"email.transfer_confirmation.content.special_arrangements.info1": "If you require special arrangements, send your application as soon as possible according to the instructions provided by the Finnish National Agency for Education.",
"email.transfer_confirmation.content.special_arrangements.info2": "You must reapply for the special arrangements for the new test day.",
"email.transfer_confirmation.content.special_arrangements.info3": "The instructions can be found on the website of the Finnish National Agency for Education",
"registration.description.listen": "Listening comprehension",
"registration.description.read": "Reading comprehension",
"registration.description.speak": "Speaking",
Expand Down
18 changes: 16 additions & 2 deletions resources/yki/localisations/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"common.testCentre": "Testipaikka",
"common.testDay": "Testipäivä",
"common.testFee": "Tutkintomaksu",
"email.cancel_registration.subject": "Ilmoittautuminen YKI-testiin on peruttu",
"email.cancel_registration.content.line1": "Ilmoittautumisesi seuraavaan YKI-testiin on peruttu",
"email.cancel_registration.content.line2": "Tutkintomaksua ei palauteta automaattisesti.",
"email.cancel_registration.content.line3": "Voit hakea tutkintomaksun palautusta Opetushallitukselta. Opetushallitus palauttaa tutkintomaksusi, jos hakemuksesi täyttää kaikki lain yleisistä kielitutkinnoista asettamat ehdot.",
"email.cancel_registration.content.line4": "Jos haluat hakea tutkintomaksun palautusta, lue ohjeet Opetushallituksen verkkosivuilta",
"email.cancel_registration.content.line5": "Jos olet jo hakenut tutkintomaksun palautusta Opetushallitukselta, sinun ei tarvitse lähettää hakemusta uudelleen.",
"email.cancel_registration.content.line6": "Jos sinulla on kysyttävää, lähetä sähköpostia osoitteeseen kielitutkinnot@oph.fi.",
"email.cancel_registration.content.link.url": "https://www.oph.fi/fi/koulutus-ja-tutkinnot/ennen-yki-testia#anchor-osallistumisen-peruminen",
"email.cancel_registration.content.link.text": "Osallistumisen peruminen",
"email.evaluation_payment.content.heading.evaluationFee": "Tarkistusarviointimaksu",
"email.evaluation_payment.content.heading.partialExams": "Osakokeet",
"email.evaluation_payment.content.orderNumber": "Tilausnumero",
Expand All @@ -46,7 +55,7 @@
"email.payment.content.line4": "Maksa tutkintomaksu tämän linkin kautta",
"email.payment.link_text": "Maksulinkki",
"email.payment.subject": "Maksulinkki (YKI)",
"email.payment_success.content.line1": "Ilmoittautumisesi on vahvistettu tutkintotilaisuuteen",
"email.payment_success.content.line1": "Ilmoittautumisesi on vahvistettu seuraavaan YKI-testiin:",
"email.payment_success.content.line2": "Testipaikkasi lähettää myöhemmin sähköpostiisi tarkemmat ohjeet testiin saapumista varten. He kertovat muun muassa testipaikan tarkan sijainnin ja kellonajan, jolloin testi alkaa.",
"email.payment_success.content.line3.part1": "Ota mukaan YKI-testiin virallinen voimassa oleva henkilöllisyystodistus.",
"email.payment_success.content.line3.part2": "Huomaa, että esimerkiksi ajokortti tai oleskelulupakortti eivät ole virallisia henkilöllisyystodistuksia. Hyväksyttäviä henkilöllisyystodistuksia ovat",
Expand All @@ -57,7 +66,7 @@
"email.payment_success.content.line5.link.text": "Osallistumisen peruminen",
"email.payment_success.content.line5.link.url": "https://www.oph.fi/fi/koulutus-ja-tutkinnot/kieli-ja-kaantajatutkinnot/yleiset-kielitutkinnot-yki/ennen-testia#anchor-osallistumisen-peruminen",
"email.payment_success.content.line6": "Viestin liitteenä on kuitti maksetusta tutkintomaksustasi.",
"email.payment_success.extra_information.label": "Lisätiedot tilaisuuden järjestäjältä",
"email.payment_success.extra_information.label": "Testipaikan lisätiedot",
"email.payment_success.idDocument.bulletPoint1": "passi",
"email.payment_success.idDocument.bulletPoint2": "henkilökortti",
"email.payment_success.idDocument.bulletPoint3": "muukalaispassi",
Expand Down Expand Up @@ -88,6 +97,11 @@
"email.receipt.examPayment.organizer": "Järjestäjä",
"email.receipt.examPayment.title": "Yleiset kielitutkinnot (YKI), tutkintomaksu",
"email.receipt.examPayment.vatZeroJustification": "Yleisten kielitutkintojen tutkintomaksut ovat opetus- ja kulttuuriministeriön asetuksella Opetushallituksen suoritteiden maksullisuudesta (1223/2022) määrättyjä maksuja, joista ei peritä arvonlisäveroa.",
"email.transfer_confirmation.subject": "Ilmoittautuminen YKI-testiin on siirretty",
"email.transfer_confirmation.content.line1": "Voit siirtää ilmoittautumista vain yhden kerran. Ilmoittautumisesi on siirretty seuraavaan YKI-testiin",
"email.transfer_confirmation.content.special_arrangements.info1": "Jos tarvitset erityisjärjestelyjä, lähetä hakemus mahdollisimman pian Opetushallituksen ohjeiden mukaan.",
"email.transfer_confirmation.content.special_arrangements.info2": "Sinun täytyy hakea erityisjärjestelyjä myös uudelle testipäivälle.",
"email.transfer_confirmation.content.special_arrangements.info3": "Ohjeet erityisjärjestelyjen hakemiseen ovat Opetushallituksen verkkosivuilla",
"registration.description.listen": "Puheen ymmärtäminen",
"registration.description.read": "Tekstin ymmärtäminen",
"registration.description.speak": "Puhuminen",
Expand Down
16 changes: 15 additions & 1 deletion resources/yki/localisations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"common.testCentre": "Testställe",
"common.testDay": "Testdatum",
"common.testFee": "Examensavgift",
"email.cancel_registration.subject": "Anmälan till YKI-testet har annullerats",
"email.cancel_registration.content.line1": "Din anmälan till följande YKI-test har annullerats",
"email.cancel_registration.content.line2": "Examensavgift återbetalas inte automatiskt.",
"email.cancel_registration.content.line3": "Du kan ansöka om återbetalning av examensavgift hos Utbildningsstyrelsen. Utbildningsstyrelsen återbetalar din examensavgift om din ansökan uppfyller alla villkor i lagen om allmänna språkexamina (YKI).",
"email.cancel_registration.content.line4": "Om du vill ansöka om återbetalning av examensavgift, läs anvisningarna på Utbildningsstyrelsen webbplats",
"email.cancel_registration.content.line5": "Om du redan har ansökt om återbetalning av examensavgift hos Utbildningsstyrelsen, behöver du inte skicka ansökan på nytt.",
"email.cancel_registration.content.line6": "Om du har frågor kan du skicka e-post till adressen kielitutkinnot@oph.fi.",
"email.cancel_registration.content.link.url": "https://www.oph.fi/sv/utbildning-och-examina/fore-yki-testdagen#anchor-annullering-av-deltagande",
"email.cancel_registration.content.link.text": "Annullering av deltagande",
"email.evaluation_payment.content.heading.evaluationFee": "Avgift för kontrollbedömning",
"email.evaluation_payment.content.heading.partialExams": "Delprov",
"email.evaluation_payment.content.orderNumber": "Beställningsnummer",
Expand Down Expand Up @@ -57,7 +66,7 @@
"email.payment_success.content.line5.link.text": "Annullering av deltagande",
"email.payment_success.content.line5.link.url": "https://www.oph.fi/sv/koulutus-ja-tutkinnot/kieli-ja-kaantajatutkinnot/yleiset-kielitutkinnot-yki/ennen-testia#anchor-annullering-av-deltagande",
"email.payment_success.content.line6": "Bifogat hittar du kvittot för din examensavgift.",
"email.payment_success.extra_information.label": "Ytterligare information från arrangören",
"email.payment_success.extra_information.label": "Ytterligare information från teststället",
"email.payment_success.idDocument.bulletPoint1": "pass",
"email.payment_success.idDocument.bulletPoint2": "identitetskort",
"email.payment_success.idDocument.bulletPoint3": "främlingspass",
Expand Down Expand Up @@ -88,6 +97,11 @@
"email.receipt.examPayment.organizer": "Arrangör",
"email.receipt.examPayment.title": "Almänna språkexamina (YKI), examensavgift",
"email.receipt.examPayment.vatZeroJustification": "Examensavgifterna för allmänna språkexamina är föreskrivna i undervisnings- och kulturministeriets förordning om Utbildningsstyrelsens avgiftsbelagda prestationer (1223/2022) och är momsfria.",
"email.transfer_confirmation.subject": "Anmälan till YKI-testet har flyttats",
"email.transfer_confirmation.content.line1": "Du kan flytta din anmälan en (1) gång. Din anmälan har flyttats till följande YKI-test",
"email.transfer_confirmation.content.special_arrangements.info1": "Om du behöver specialarrangemang, skicka en ansökan enligt Utbildningsstyrelsens anvisningar så fort som möjligt.",
"email.transfer_confirmation.content.special_arrangements.info2": "Du ska ansöka om specialarrangemang även för den nya testdagen.",
"email.transfer_confirmation.content.special_arrangements.info3": "Anvisningar finns på Utbildningsstyrelsens webbsidor",
"registration.description.listen": "Talförståelse",
"registration.description.read": "Textförståelse",
"registration.description.speak": "Tal",
Expand Down
35 changes: 35 additions & 0 deletions resources/yki/queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,41 @@ WHERE re.id = :id
AND re.state = 'COMPLETED'
AND esl.lang = :lang;

-- name: select-registration-details-for-clerk-mail
SELECT re.state,
re.exam_session_id,
re.participant_id,
re.kind,
re.form->>'email' AS email,
re.form->>'last_name' AS last_name,
re.form->>'first_name' AS first_name,
re.form->>'certificate_lang' AS lang,
es.language_code,
es.level_code,
ed.exam_date,
ed.registration_end_date,
ed.post_admission_end_date,
esl.street_address,
esl.post_office,
esl.zip,
esl.name
FROM registration re
INNER JOIN exam_session es ON es.id = re.exam_session_id
INNER JOIN exam_date ed ON ed.id = es.exam_date_id
INNER JOIN exam_session_location esl ON esl.exam_session_id = es.id
WHERE re.id = :id
AND re.exam_session_id = :exam_session_id
AND (re.state = 'SUBMITTED' OR re.state = 'COMPLETED' OR re.state = 'PAID_AND_CANCELLED')
ORDER BY CASE
WHEN esl.lang = re.form->>'certificate_lang' THEN 1
WHEN esl.lang = 'fi' THEN 2
WHEN esl.lang = 'en' THEN 3 ELSE 4 END;

-- name: select-completed-registration-lang
SELECT re.form->>'certificate_lang' AS certificate_lang
FROM registration re
WHERE re.id = :id

-- name: select-open-registrations-by-participant
SELECT re.exam_session_id, (started_at + interval '30 minutes') AS expires_at
FROM registration re
Expand Down
60 changes: 60 additions & 0 deletions resources/yki/templates/cancel_registration.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{% extends "yki/templates/base_message.html" %} {% block content %}
<tr>
<td style="padding-left: 20px;">
{% i18n email.cancel_registration.content.line1 %}:
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 10px;">
{% i18n common.test %}: {{language}} {{level|lower}}
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
{% i18n common.testDay %}: {{exam_date|date-format-with-dots}}
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
{% i18n common.testCentre %}: {{name}}, {{street_address}}, {{zip}} {{post_office|upper}}
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.cancel_registration.content.line2 %}
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.cancel_registration.content.line3 %}
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px">
{% i18n email.cancel_registration.content.line4 %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<a href="{% i18n email.cancel_registration.content.link.url %}" target="_blank">{% i18n email.cancel_registration.content.link.text %}</a>
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.cancel_registration.content.line5 %}
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.cancel_registration.content.line6 %}
</td>
</tr>


{% endblock %}
141 changes: 141 additions & 0 deletions resources/yki/templates/transfer_confirmation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{% extends "yki/templates/base_message.html" %} {% block content %}
<tr>
<td style="padding-left: 20px;">
{% i18n email.transfer_confirmation.content.line1 %}:
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 10px;">
{% i18n common.test %}: {{language}} {{level|lower}}
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
{% i18n common.testDay %}: {{exam_date|date-format-with-dots}}
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
{% i18n common.testCentre %}: {{name}}, {{street_address}}, {{zip}} {{post_office|upper}}
</td>
</tr>

{% if extra_information %}
<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.extra_information.label %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
{{ extra_information }}
</td>
</tr>
{% endif %}

{% if contact_info %}
<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.organizer_contact.label %}:
</td>
</tr>
{% if contact_info.name %}
<tr>
<td style="padding-left: 20px;">
{% i18n email.payment_success.organizer_contact.name %}: {{ contact_info.name }}
</td>
</tr>
{% endif %}
{% if contact_info.email %}
<tr>
<td style="padding-left: 20px;">
{% i18n email.payment_success.organizer_contact.email %}: {{ contact_info.email }}
</td>
</tr>
{% endif %}
{% if contact_info.phone_number %}
<tr>
<td style="padding-left: 20px;">
{% i18n email.payment_success.organizer_contact.phoneNumber %}: {{ contact_info.phone_number }}
</td>
</tr>
{% endif %}
{% endif %}

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.content.line2 %}
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px">
{% i18n email.transfer_confirmation.content.special_arrangements.info1 %} <b>{% i18n email.transfer_confirmation.content.special_arrangements.info2 %}</b> {% i18n email.transfer_confirmation.content.special_arrangements.info3 %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<a href="{% i18n email.payment_success.special_arrangements.link.url %}" target="_blank">{% i18n email.payment_success.special_arrangements.link.text %}</a>
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
<b>{% i18n email.payment_success.content.line3.part1 %}</b> {% i18n email.payment_success.content.line3.part2 %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<li style="padding-left: 10px;">{% i18n email.payment_success.idDocument.bulletPoint1 %}</li>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<li style="padding-left: 10px;">{% i18n email.payment_success.idDocument.bulletPoint2 %}</li>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<li style="padding-left: 10px;">{% i18n email.payment_success.idDocument.bulletPoint3 %}</li>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<li style="padding-left: 10px;">{% i18n email.payment_success.idDocument.bulletPoint4 %}</li>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<li style="padding-left: 10px;">{% i18n email.payment_success.idDocument.bulletPoint5 %}</li>
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.content.line4 %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<a href="{% i18n email.payment_success.content.line4.link.url %}" target="_blank">{% i18n email.payment_success.content.line4.link.text %}</a>
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.content.line5 %}:
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<a href="{% i18n email.payment_success.content.line5.link.url %}" target="_blank">{% i18n email.payment_success.content.line5.link.text %}</a>
</td>
</tr>

<tr>
<td style="padding-left: 20px; padding-top: 20px;">
{% i18n email.payment_success.content.line6 %}
</td>
</tr>
{% endblock %}
Loading

0 comments on commit a372672

Please sign in to comment.