-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VKT(Frontend & Backend): More emails and various fixes to examiner en…
…rollment functions [deploy]
- Loading branch information
Showing
22 changed files
with
284 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
backend/vkt/src/main/java/fi/oph/vkt/service/ContactEmailService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package fi.oph.vkt.service; | ||
|
||
import static fi.oph.vkt.util.LocalisationUtil.localeFI; | ||
import static fi.oph.vkt.util.LocalisationUtil.localeSV; | ||
|
||
import fi.oph.vkt.model.EmailType; | ||
import fi.oph.vkt.model.EnrollmentAppointment; | ||
import fi.oph.vkt.model.Examiner; | ||
import fi.oph.vkt.service.email.EmailService; | ||
import fi.oph.vkt.util.LocalisationUtil; | ||
import fi.oph.vkt.util.TemplateRenderer; | ||
import java.io.IOException; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class ContactEmailService extends AbstractEnrollmentEmailService { | ||
|
||
private final EmailService emailService; | ||
private final TemplateRenderer templateRenderer; | ||
|
||
@Transactional | ||
public void sendEnrollmentAppointmentAuthLink(final EnrollmentAppointment enrollment) | ||
throws IOException, InterruptedException { | ||
final Map<String, Object> templateParams = new HashMap<>(Map.of()); | ||
final Examiner examiner = enrollment.getExaminer(); | ||
|
||
templateParams.put("type", "enrollment"); | ||
|
||
final String recipientName = examiner.getFirstName() + " " + examiner.getLastName(); | ||
final String recipientAddress = examiner.getEmail(); | ||
final String subject = String.format( | ||
"%s | %s", | ||
LocalisationUtil.translate(localeFI, "subject.contact-request"), | ||
LocalisationUtil.translate(localeSV, "subject.contact-request") | ||
); | ||
final String body = templateRenderer.renderContactRequest(templateParams); | ||
|
||
createEmail( | ||
emailService, | ||
recipientName, | ||
recipientAddress, | ||
subject, | ||
body, | ||
List.of(), | ||
EmailType.ENROLLMENT_CONTACT_REQUEST | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
backend/vkt/src/main/resources/email-templates/enrollment-appointment-confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html lang="fi" xmlns:th="http://www.thymeleaf.org"> | ||
<body> | ||
<p> | ||
Hei, | ||
</p> | ||
<br/> | ||
<p>Olet ilmoittautunut Valtionhallinnon kielitutkintoon. Ohessa tiedot ilmoittautumisestasi. Liitteenä myös maksukuitti suomeksi ja ruotsiksi.</p> | ||
<br/> | ||
|
||
<p> | ||
<b>Tutkinnon kieli:</b> <span th:text="${examLanguageFI}"></span><br/> | ||
<b>Tutkinnon taso:</b> <span th:text="${examLevelFI}"></span><br/> | ||
<b>Tutkintopäivä:</b> <span th:text="${examDate}"></span><br/> | ||
<b>Valitsemasi taidot:</b> <span th:text="${skillsFI}"></span><br/> | ||
<b>Valitsemasi osakokeet:</b> <span th:text="${partialExamsFI}"></span><br/> | ||
</p> | ||
<br/> | ||
|
||
<p><b>Tietoa tutkintotilaisuudesta</b></p> | ||
|
||
<p>Tutkintotilaisuus järjestetään Opetushallituksen tiloissa osoitteessa Hakaniemenranta 6, 00530 Helsinki.</p> | ||
<p>Tutkinnon suorittamiseen kannattaa varata koko päivä. Tutkintotilaisuus alkaa klo 9.00 kirjallisen taidon tutkinnolla ja jatkuu iltapäivällä suullisen taidon tutkinnolla. Tutkinnon päättymisaika riippuu tutkintoon osallistuvien määrästä. Saat tarkemmat ohjeet tutkintopäivän kulusta viikkoa ennen tutkintopäivää.</p> | ||
<p>Jos sinulla on kysyttävää tutkinnosta, voit lähettää meille sähköpostia osoitteeseen <a href="mailto:[email protected]">[email protected]</a>. Ilmoitathan viipymättä, jos et pysty osallistumaan tutkintoon.</p> | ||
<p> | ||
Lisätietoa tutkinnosta löydät Opetushallituksen verkkopalvelusta:<br/> | ||
<a href="https://www.oph.fi/fi/koulutus-ja-tutkinnot/erinomaisen-taidon-tutkinnot" target="_blank">Valtionhallinnon kielitutkinnot (VKT)</a> | ||
</p> | ||
<br/> | ||
|
||
<p> | ||
Älä vastaa tähän viestiin - viesti on lähetetty automaattisesti. | ||
</p> | ||
<p style="border-bottom: 1px solid black; padding-bottom: 15px;"> | ||
Ystävällisin terveisin<br/> | ||
Opetushallitus | ||
</p> | ||
|
||
<p> | ||
Hej, | ||
</p> | ||
<br/> | ||
<p>Du har anmält dig till Språkexamen för statsförvaltningen (VKT). Uppgifter om din anmälan hittar du nedan. Bifogat finns även kvittot för din examensavgift på finska och på svenska.</p> | ||
<br/> | ||
|
||
<p> | ||
<b>Examensspråk:</b> <span th:text="${examLanguageSV}"></span><br/> | ||
<b>Examensnivå:</b> <span th:text="${examLevelSV}"></span><br/> | ||
<b>Examensdatum:</b> <span th:text="${examDate}"></span><br/> | ||
<b>Förmågor som du har valt:</b> <span th:text="${skillsSV}"></span><br/> | ||
<b>Delprov som du har valt:</b> <span th:text="${partialExamsSV}"></span><br/> | ||
</p> | ||
<br/> | ||
<p><b>Information om examenstillfället</b></p> | ||
|
||
<p>Examenstillfället ordnas vid Utbildningsstyrelsen på adressen Hagnäskajen 6, 00530 Helsingfors.</p> | ||
<p>Du bör reservera hela dagen för examen. Examenstillfället börjar klockan 9.00 med delprovet i skriftlig färdighet och fortsätter på eftermiddagen med delprovet i muntlig färdighet. Deltagarantalet avgör när examenstillfället slutar. Du får närmare anvisningar om examensdagens program en vecka före examensdagen.</p> | ||
<p>Om du har frågor om examen, kan du kontakta oss per e-post på adressen <a href="mailto:[email protected]">[email protected]</a>. Vänligen meddela omedelbart om du inte kan delta i examen.</p> | ||
<p> | ||
Närmare information om examen finns på Utbildningsstyrelsens webbplats:<br/> | ||
<a href="https://www.oph.fi/sv/utbildning-och-examina/examina-som-galler-utmarkta-sprakkunskaper" target="_blank">Språkexamina för statsförvaltningen (VKT)</a> | ||
</p> | ||
<br/> | ||
|
||
<p> | ||
Svara inte på detta meddelande, det har skickats automatiskt. | ||
</p> | ||
<p> | ||
Med vänlig hälsning<br/> | ||
Utbildningsstyrelsen | ||
</p> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
backend/vkt/src/main/resources/email-templates/examiner-contact-request.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="fi" xmlns:th="http://www.thymeleaf.org"> | ||
<body> | ||
<p> | ||
Hei, | ||
</p> | ||
|
||
<p>Olet saanut yhteydenottopyynnön.</p> | ||
<br/> | ||
<p>Tarkastele yhteydenottopyynnön tietoja VKT palvelussa.</p> | ||
|
||
<p> | ||
Älä vastaa tähän viestiin - viesti on lähetetty automaattisesti. | ||
</p> | ||
<p style="border-bottom: 1px solid black; padding-bottom: 15px;"> | ||
Ystävällisin terveisin<br/> | ||
Opetushallitus | ||
</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.