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

HAI-1526 Add functions to send hanke and application invitation emails #399

Merged
merged 6 commits into from
Sep 6, 2023
Merged
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ See docker-compose.yml for details.
Swagger UI (see https://springdoc.org/) and OpenAPI v3 description (JSON). You
can use the Swagger UI to send requests, if you copy your bearer token over from
the browser. So,

1. Log in to Haitaton.
2. Open the Network tab from developer tools.
3. Open e.g. Omat Hankkeet in Haitaton.
Expand Down Expand Up @@ -164,6 +165,13 @@ cd haitaton-backend
When running locally, the system emails are sent to smtp4dev, which is started as part of the Docker
Compose setup. You can access the sent emails by opening http://localhost:3003.

Creation of new emails is done with [mjml.io](https://mjml.io/). Either IntelliJ or Visual Studio Code plugin MJML is
corvidian marked this conversation as resolved.
Show resolved Hide resolved
needed. Mjml templates are located in email/. The output email content (html) is in
hanke-service/resources/email/template.

Once the Mjml template is done, it is converted to html. For example in Visual Studio, type >MJML:Copy HTML. The html
output is the actual email content.

## File scan

Haitaton supports uploading of attachment files. Files are validated with ClamAV anti-malware tool.
Expand Down
5 changes: 5 additions & 0 deletions email/common/attributes.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<mj-attributes>
<mj-class name="header-txt" font-size="36px" padding="16px 24px 16px 24px"/>
<mj-class name="basic-txt" font-size="16px" padding="16px 24px 16px 24px"/>
<mj-all font-family="Arial"/>
</mj-attributes>
26 changes: 26 additions & 0 deletions email/common/footer-content.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<mj-section background-color="#FFC61E">
<mj-column>
<mj-raw>
<div style="display: flex; align-items: center;">
<div style="padding-left: 24px; padding-top: 5px; padding-bottom: 16px">
<svg xmlns="http://www.w3.org/2000/svg" width="87" height="40" viewBox="0 0 131 60"
fill="none">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M126.726 3.75164V38.251C126.726 44.836 121.268 50.2143 114.544 50.2143H77.4422C72.9858 50.2143 68.7667 51.8146 65.4706 54.7792C62.1744 51.8408 57.9554 50.2143 53.499 50.2143H16.3185C9.64705 50.2143 4.24137 44.8623 4.24137 38.251V3.75164H126.726ZM67.4483 58.0586C70.1115 55.4088 73.6714 53.9397 77.4686 53.9397H114.544C123.325 53.9397 130.471 46.9086 130.471 38.251V0H0.470581V38.2247C0.470581 46.8824 7.56389 53.9134 16.3185 53.9134H53.499C57.2698 53.9134 60.8296 55.3826 63.5193 58.0324L65.4969 60L67.4483 58.0586Z"
fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M113.008 19.4591C113.008 20.5954 112.081 21.4218 110.915 21.4218C109.75 21.4218 108.823 20.5954 108.823 19.4591C108.823 18.3228 109.75 17.4964 110.915 17.4964C112.081 17.4448 113.008 18.2712 113.008 19.4591ZM109.088 35.4961H112.717V22.9196H109.088V35.4961ZM102.572 27.9037L107.313 35.4961H103.367L100.189 30.4604L98.4671 32.578V35.4961H94.865V17.4189H98.4671V25.7603C98.4671 27.3098 98.2817 28.8592 98.2817 28.8592H98.3612C98.3612 28.8592 99.2087 27.4905 99.9238 26.5092L102.678 22.9196H106.916L102.572 27.9037ZM91.21 27.4389C91.21 24.3141 89.6473 22.6097 87.1576 22.6097C85.0388 22.6097 83.9263 23.8234 83.2907 24.9855H83.2112L83.3966 22.9196H79.7945V35.4961H83.3966V28.0328C83.3966 26.5867 84.2707 25.5795 85.6214 25.5795C86.9722 25.5795 87.5549 26.4575 87.5549 28.1361V35.4961H91.1835L91.21 27.4389ZM76.3249 19.4591C76.3249 20.5954 75.3979 21.4218 74.2325 21.4218C73.0671 21.4218 72.1401 20.5954 72.1401 19.4591C72.1401 18.3228 73.0671 17.4964 74.2325 17.4964C75.4244 17.4448 76.3249 18.2712 76.3249 19.4591ZM72.405 35.4961H76.0335V22.9196H72.405V35.4961ZM66.1543 31.984C66.1543 30.9768 64.7241 30.7703 63.0554 30.3054C61.122 29.8147 58.6853 28.8592 58.6853 26.4575C58.6853 24.0817 61.016 22.5839 63.7706 22.5839C66.3397 22.5839 68.6969 23.7718 69.6769 25.4504L66.5781 27.1548C66.2602 26.0444 65.3067 25.1663 63.8765 25.1663C62.9495 25.1663 62.1814 25.5537 62.1814 26.3026C62.1814 27.2581 63.8765 27.3614 65.7835 27.9554C67.7964 28.5752 69.6504 29.479 69.6504 31.7774C69.6504 34.3082 67.2402 35.806 64.4592 35.806C61.4398 35.806 59.0561 34.5665 57.9966 32.5521L61.1485 30.8219C61.5457 32.1906 62.6846 33.2236 64.4062 33.2236C65.4392 33.2236 66.1543 32.8104 66.1543 31.984ZM54.6859 17.5222H51.0573V32.0098C51.0573 33.3011 51.3487 34.2566 51.9049 34.8505C52.4876 35.4445 53.3881 35.7286 54.6329 35.7286C55.0567 35.7286 55.507 35.6769 55.9307 35.5994C56.381 35.4961 56.7253 35.367 57.0167 35.2121L57.3345 32.8362C57.0431 32.9395 56.8048 33.017 56.5664 33.0428C56.3545 33.0945 56.0896 33.0945 55.7983 33.0945C55.3216 33.0945 55.1097 32.9653 54.9507 32.7329C54.7654 32.5005 54.6859 32.0873 54.6859 31.4933V17.5222ZM42.6083 25.1405C41.284 25.1405 40.1981 26.0702 39.9067 27.7746H44.992C45.0185 26.2768 44.0121 25.1405 42.6083 25.1405ZM48.1968 30.1505H39.8538C40.0127 32.1906 41.1781 33.1978 42.6878 33.1978C44.0386 33.1978 44.9656 32.3197 45.1774 31.1318L48.2233 32.8104C47.3228 34.4115 45.3893 35.806 42.6878 35.806C39.0857 35.806 36.4371 33.3527 36.4371 29.2208C36.4371 25.1147 39.1387 22.6355 42.6083 22.6355C46.078 22.6355 48.3822 25.0372 48.3822 28.446C48.3558 29.4532 48.1968 30.1505 48.1968 30.1505ZM29.7362 35.4961H33.4972V18.1937H29.7362V25.0372H22.6644V18.2195H18.9034V35.4961H22.6644V28.3427H29.7362V35.4961Z"
fill="black"/>
</svg>
</div>
<div style="padding-left: 16px; padding-top: 12px; padding-bottom: 26px; font-family: Arial; font-size: 16px;">
Haitaton
</div>
</div>
</mj-raw>
<mj-divider border-color="#999898" border-width="1px" padding="0px 24px 16px 24px"/>
<mj-text padding="0px 24px 0px 24px" color="#000000" font-family="Arial" font-size="16px">© Helsingin
kaupunki 2023
</mj-text>
</mj-column>
</mj-section>
22 changes: 22 additions & 0 deletions email/common/header-content.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mj-section>
<mj-column>
<mj-raw>
<div style="display: flex; align-items: center;">
<div style="padding-left: 24px; padding-top: 16px">
<svg xmlns="http://www.w3.org/2000/svg" width="131" height="60" viewBox="0 0 131 60"
fill="none">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M126.726 3.75164V38.251C126.726 44.836 121.268 50.2143 114.544 50.2143H77.4422C72.9858 50.2143 68.7667 51.8146 65.4706 54.7792C62.1744 51.8408 57.9554 50.2143 53.499 50.2143H16.3185C9.64705 50.2143 4.24137 44.8623 4.24137 38.251V3.75164H126.726ZM67.4483 58.0586C70.1115 55.4088 73.6714 53.9397 77.4686 53.9397H114.544C123.325 53.9397 130.471 46.9086 130.471 38.251V0H0.470581V38.2247C0.470581 46.8824 7.56389 53.9134 16.3185 53.9134H53.499C57.2698 53.9134 60.8296 55.3826 63.5193 58.0324L65.4969 60L67.4483 58.0586Z"
fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd"
d="M113.008 19.4591C113.008 20.5954 112.081 21.4218 110.915 21.4218C109.75 21.4218 108.823 20.5954 108.823 19.4591C108.823 18.3228 109.75 17.4964 110.915 17.4964C112.081 17.4448 113.008 18.2712 113.008 19.4591ZM109.088 35.4961H112.717V22.9196H109.088V35.4961ZM102.572 27.9037L107.313 35.4961H103.367L100.189 30.4604L98.4671 32.578V35.4961H94.865V17.4189H98.4671V25.7603C98.4671 27.3098 98.2817 28.8592 98.2817 28.8592H98.3612C98.3612 28.8592 99.2087 27.4905 99.9238 26.5092L102.678 22.9196H106.916L102.572 27.9037ZM91.21 27.4389C91.21 24.3141 89.6473 22.6097 87.1576 22.6097C85.0388 22.6097 83.9263 23.8234 83.2907 24.9855H83.2112L83.3966 22.9196H79.7945V35.4961H83.3966V28.0328C83.3966 26.5867 84.2707 25.5795 85.6214 25.5795C86.9722 25.5795 87.5549 26.4575 87.5549 28.1361V35.4961H91.1835L91.21 27.4389ZM76.3249 19.4591C76.3249 20.5954 75.3979 21.4218 74.2325 21.4218C73.0671 21.4218 72.1401 20.5954 72.1401 19.4591C72.1401 18.3228 73.0671 17.4964 74.2325 17.4964C75.4244 17.4448 76.3249 18.2712 76.3249 19.4591ZM72.405 35.4961H76.0335V22.9196H72.405V35.4961ZM66.1543 31.984C66.1543 30.9768 64.7241 30.7703 63.0554 30.3054C61.122 29.8147 58.6853 28.8592 58.6853 26.4575C58.6853 24.0817 61.016 22.5839 63.7706 22.5839C66.3397 22.5839 68.6969 23.7718 69.6769 25.4504L66.5781 27.1548C66.2602 26.0444 65.3067 25.1663 63.8765 25.1663C62.9495 25.1663 62.1814 25.5537 62.1814 26.3026C62.1814 27.2581 63.8765 27.3614 65.7835 27.9554C67.7964 28.5752 69.6504 29.479 69.6504 31.7774C69.6504 34.3082 67.2402 35.806 64.4592 35.806C61.4398 35.806 59.0561 34.5665 57.9966 32.5521L61.1485 30.8219C61.5457 32.1906 62.6846 33.2236 64.4062 33.2236C65.4392 33.2236 66.1543 32.8104 66.1543 31.984ZM54.6859 17.5222H51.0573V32.0098C51.0573 33.3011 51.3487 34.2566 51.9049 34.8505C52.4876 35.4445 53.3881 35.7286 54.6329 35.7286C55.0567 35.7286 55.507 35.6769 55.9307 35.5994C56.381 35.4961 56.7253 35.367 57.0167 35.2121L57.3345 32.8362C57.0431 32.9395 56.8048 33.017 56.5664 33.0428C56.3545 33.0945 56.0896 33.0945 55.7983 33.0945C55.3216 33.0945 55.1097 32.9653 54.9507 32.7329C54.7654 32.5005 54.6859 32.0873 54.6859 31.4933V17.5222ZM42.6083 25.1405C41.284 25.1405 40.1981 26.0702 39.9067 27.7746H44.992C45.0185 26.2768 44.0121 25.1405 42.6083 25.1405ZM48.1968 30.1505H39.8538C40.0127 32.1906 41.1781 33.1978 42.6878 33.1978C44.0386 33.1978 44.9656 32.3197 45.1774 31.1318L48.2233 32.8104C47.3228 34.4115 45.3893 35.806 42.6878 35.806C39.0857 35.806 36.4371 33.3527 36.4371 29.2208C36.4371 25.1147 39.1387 22.6355 42.6083 22.6355C46.078 22.6355 48.3822 25.0372 48.3822 28.446C48.3558 29.4532 48.1968 30.1505 48.1968 30.1505ZM29.7362 35.4961H33.4972V18.1937H29.7362V25.0372H22.6644V18.2195H18.9034V35.4961H22.6644V28.3427H29.7362V35.4961Z"
fill="black"/>
</svg>
</div>
<div style="padding-left: 16px; padding-top: 12px; font-family: Arial; font-size: 24px;">
Haitaton
</div>
</div>
</mj-raw>
</mj-column>
</mj-section>
109 changes: 109 additions & 0 deletions email/johtoselvitys-valmis.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<mjml>
<mj-head>
<mj-include path="common/attributes.mjml"/>
</mj-head>
<mj-body>
<mj-include path="common/header-content.mjml"/>
<mj-section>
<mj-column>
<mj-text mj-class="header-txt">Haitaton: Johtoselvitys
{{applicationIdentifier}}
</mj-text>
<mj-text mj-class="basic-txt">
Hakemanne johtoselvitys {{applicationIdentifier}} on käsitelty. Lataa selvitys Haitattomasta <a
href="{{baseUrl}}/fi/hakemus/{{applicationId}}">{{baseUrl}}/fi/hakemus/{{applicationId}}
</a> ja tutustu sen sisältöön huolellisesti.
</mj-text>
<mj-text mj-class="basic-txt">
Miten onnistuimme? Kerro mielipiteesi <a
href="https://response.questback.com/isa/qbv.dll/bylink?p=x6TIpQ4sCcJt9Dv1T-AuuKa-DssX27rx6er2ohTVVipooPTA8H0u-weNFWY9GsVI0">
täällä</a>.
</mj-text>
<mj-text mj-class="basic-txt">
Ystävällisin terveisin,
<br/>
<br/>
Helsingin kaupunkiympäristön asukas- ja yrityspalvelut
<br/>
Alueidenkäyttö ja -valvonta
<br/>
Johtotietopalvelu
<br/>
Puh. 09 310 31940
<br/>
[email protected]
</mj-text>
</mj-column>
</mj-section>
<mj-section>
<mj-column>
<mj-text mj-class="header-txt">
Haitaton: Ledningsutredning {{applicationIdentifier}}
</mj-text>
<mj-text mj-class="basic-txt">
Ledningsutredningen {{applicationIdentifier}} ni ansökt om har behandlats. Ladda ned utredningen
från Haitaton
<a href="{{baseUrl}}/sv/ansokan/{{applicationId}}">
{{baseUrl}}/sv/ansokan/{{applicationId}}
</a>
och läs
innehållet i den noggrannt.
</mj-text>
<mj-text mj-class="basic-txt">
Hur lyckades vi? Ge din åsikt <a
href="https://response.questback.com/isa/qbv.dll/bylink?p=x6TIpQ4sCcJt9Dv1T-AuuKa-DssX27rx6er2ohTVVipooPTA8H0u-weNFWY9GsVI0">
här</a>.
</mj-text>
<mj-text mj-class="basic-txt">
Med vänlig hälsning,
<br/>
<br/>
Helsingfors stadsmiljös boende- och företagstjänster
<br/>
Användning och tillsyn av områden
<br/>
Ledningstjänsten
<br/>
Tfn 09 310 31940
<br/>
[email protected]
</mj-text>
</mj-column>
</mj-section>
<mj-section>
<mj-column>
<mj-text mj-class="header-txt">
Haitaton: Cable report {{applicationIdentifier}}
</mj-text>
<mj-text mj-class="basic-txt">
Cable report {{applicationIdentifier}} that you requested has been processed. Download the
report
via Haitaton <a href="{{baseUrl}}/en/application/{{applicationId}}">
{{baseUrl}}/en/application/{{applicationId}}
</a> and read it carefully.
</mj-text>
<mj-text mj-class="basic-txt">
How did we do? Please share your opinion <a
href="https://response.questback.com/isa/qbv.dll/bylink?p=x6TIpQ4sCcJt9Dv1T-AuuKa-DssX27rx6er2ohTVVipooPTA8H0u-weNFWY9GsVI0">
here</a>.
</mj-text>
<mj-text mj-class="basic-txt">
Kind regards,
<br/>
<br/>
Helsinki Urban Environment Resident and Business Services
<br/>
Land Use and Monitoring
<br/>
Cable Location Service
<br/>
Tel. +358 9 310 31940
<br/>
[email protected]
<br/>
</mj-text>
</mj-column>
</mj-section>
<mj-include path="common/footer-content.mjml"/>
</mj-body>
</mjml>
44 changes: 44 additions & 0 deletions email/kayttaja-lisatty-hakemus.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<mjml>
<mj-head>
<mj-include path="common/attributes.mjml"/>
</mj-head>
<mj-body>
<mj-include path="common/header-content.mjml"/>
<mj-section>
<mj-column>
<mj-text mj-class="header-txt">
Haitaton: Sinut on lisätty hakemukselle {{applicationIdentifier}}
</mj-text>
<mj-text mj-class="basic-txt">
{{inviterInfo}} on tehnyt {{applicationType}} ({{applicationIdentifier}}) hankkeella
{{hankeTunnus}}, ja lähettänyt sen käsittelyyn. Sinut on määritetty hakemuksella rooliin
{{recipientRole}}. Tarkastele hakemusta Haitattomassa
<a href="{{baseUrl}}">{{baseUrl}}</a>
</mj-text>
<mj-text mj-class="basic-txt">
Löydät hakemuksesi siirtymällä etusivulta Omiin hankkeisiin ja valitsemalla sieltä oikean
hankkeen.
Avaa listanäkymässä hankkeen tiedot ja valitse "Näytä hankkeen hakemukset".
</mj-text>
<mj-text mj-class="basic-txt">
Haitaton on Helsingin kaupungin asiointijärjestelmä yleisille alueille sijoittuvien hankkeiden
edistämiseen ja haittojen hallintaan.
</mj-text>
<mj-text mj-class="basic-txt">
Tämä on automaattinen sähköposti – älä vastaa tähän viestiin.
</mj-text>
<mj-text mj-class="basic-txt">
Ystävällisin terveisin,
<br/>
<br/>
Helsingin kaupungin kaupunkiympäristön toimiala
<br/>
Haitaton-asiointi
<br/>
[email protected]
</mj-text>
</mj-column>
</mj-section>
<mj-include path="common/footer-content.mjml"/>
</mj-body>
</mjml>
43 changes: 43 additions & 0 deletions email/kayttaja-lisatty-hanke.mjml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<mjml>
<mj-head>
<mj-include path="common/attributes.mjml"/>
</mj-head>
<mj-body>
<mj-include path="common/header-content.mjml"/>
<mj-section>
<mj-column>
<mj-text mj-class="header-txt">
Haitaton: Sinut on lisätty hankkeelle {{hankeTunnus}}
</mj-text>
<mj-text mj-class="basic-txt">
{{inviterInfo}} lisäsi sinut hankkeelle <b>{{hankeNimi}} ({{hankeTunnus}})</b>. Tunnistaudu
Haitattomaan alla olevan linkin kautta.
</mj-text>
<mj-text mj-class="basic-txt">
<a href="{{baseUrl}}/{{invitationToken}}">Haitattomaan</a>
</mj-text>
<mj-text mj-class="basic-txt">
Löydät hankkeesi Haitattoman etusivun Omat hankkeet -osion alta hankkeen nimellä.
</mj-text>
<mj-text mj-class="basic-txt">
Haitaton on Helsingin kaupungin asiointijärjestelmä yleisille alueille sijoittuvien hankkeiden
edistämiseen ja haittojen hallintaan.
</mj-text>
<mj-text mj-class="basic-txt">
Tämä on automaattinen sähköposti – älä vastaa tähän viestiin.
</mj-text>
<mj-text mj-class="basic-txt">
Ystävällisin terveisin,
<br/>
<br/>
Helsingin kaupungin kaupunkiympäristön toimiala
<br/>
Haitaton-asiointi
<br/>
[email protected]
</mj-text>
</mj-column>
</mj-section>
<mj-include path="common/footer-content.mjml"/>
</mj-body>
</mjml>
Loading
Loading