From 89bbaa808f4025a02b958970598dbbc2217c09c5 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Wed, 11 Dec 2024 00:07:15 +0100 Subject: [PATCH 01/24] adding style for email templates --- Dockerfile | 5 + .../resources/assets/css/template-style.css | 97 ++++++++++++++++++ .../resources/assets/img/button-primary .svg | 12 +++ src/main/resources/assets/img/yivi-banner.png | Bin 0 -> 4434 bytes src/main/resources/email-en.html | 95 ++++++++++++++--- src/main/resources/email-nl.html | 93 ++++++++++++++--- 6 files changed, 274 insertions(+), 28 deletions(-) create mode 100644 src/main/resources/assets/css/template-style.css create mode 100644 src/main/resources/assets/img/button-primary .svg create mode 100644 src/main/resources/assets/img/yivi-banner.png diff --git a/Dockerfile b/Dockerfile index 05e6f48..76e6bf6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,14 @@ COPY --from=webappbuild /www/ /usr/local/tomee/webapps/ROOT/ # Copy the war file to the webapps directory COPY --from=javabuild /app/build/libs/irma_email_issuer.war /usr/local/tomee/webapps/ + +# Copy template files to the email templates directory COPY ./src/main/resources/email-en.html /email-templates/email-en.html COPY ./src/main/resources/email-nl.html /email-templates/email-nl.html +# Copy the assets folder for styling the email templates +COPY ./src/main/resources/assets /email-templates/assets + RUN mkdir /usr/local/keys ENV IRMA_CONF="/config/" diff --git a/src/main/resources/assets/css/template-style.css b/src/main/resources/assets/css/template-style.css new file mode 100644 index 0000000..07a81df --- /dev/null +++ b/src/main/resources/assets/css/template-style.css @@ -0,0 +1,97 @@ +body { + margin: 0; + padding: 0; + min-height: 100%; + width: 100%; +} +.email-body { + background-color: #ffffff; + color: #b9113d; + font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; + font-size: 16px; + font-weight: 400; + letter-spacing: 0.15008px; + line-height: 1.5; + padding: 32px 0; +} +.email-table { + margin: 0 auto; + max-width: 600px; + background-color: #ffffff; + border-radius: 0; +} +.email-header { + padding: 16px 24px; +} +.email-banner { + outline: none; + border: none; + text-decoration: none; + vertical-align: top; + display: inline-block; + max-width: 100%; +} +.email-title { + font-weight: bold; + margin: 0; + font-size: 24px; + padding: 16px 24px; +} +.email-text { + color: #a3244a; + font-size: 18px; + font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; + font-weight: normal; + text-align: left; + padding: 16px 24px; +} +.email-button-container { + background-color: #ffffff; + text-align: center; + padding: 16px 24px; +} +.email-button { + color: #ffffff; + font-size: 16px; + font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; + font-weight: bold; + background-color: #f4f1f1; + border-radius: 4px; + display: block; + padding: 16px 32px; + text-decoration: none; + background: #a3244a url('../img/button-primary.svg') no-repeat right; +} +.email-footer-text { + color: #a3244a; + font-size: 18px; + font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; + font-weight: normal; + padding: 16px 24px; +} +.email-divider hr { + width: 100%; + border: none; + border-top: 3px solid #8b173a; + margin: 0; +} +.email-footer { + color: #a3244a; + font-size: 16px; + font-family: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; + font-weight: normal; + padding: 16px 24px; + display: flex; + flex-direction: column; + gap: 8px; +} +.email-footer p { + display: flex; + align-items: center; + gap: 8px; + margin: 0; +} +.email-footer .icon { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/src/main/resources/assets/img/button-primary .svg b/src/main/resources/assets/img/button-primary .svg new file mode 100644 index 0000000..b1a8d57 --- /dev/null +++ b/src/main/resources/assets/img/button-primary .svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/src/main/resources/assets/img/yivi-banner.png b/src/main/resources/assets/img/yivi-banner.png new file mode 100644 index 0000000000000000000000000000000000000000..bccc3e12cc21d060e21aa0b7e554d63f977363db GIT binary patch literal 4434 zcmXX~c{J2-)E|wlku6_qvZonTW6!>1)G#!LQ7Ajfu8<6cOqlHZ5@wjln(b#N+ccJ` z>}v?U60&9~(h;)d>5jfN*c z70oj~%+7hcLq|+R|=AXR>E#QuoY03FIKCwFnYf1W5dWpesv2nN8qR;$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{aIZ#b;Ihm8$>;C7(is_nekW|{H1CeeE_wiqSY1;pJ!sCuL3rrliWIPjuUL?HstG%JvBJX=ZMR zcsGq16Mx76+-87qZx^S&9RYQala(VKd5LZZuANfGeE4F$FmFzVr_TL%asuzjf`qP+l9Tl(c9177$RBcO48=q(!x()KYT7TI|m{>Idc@0*m? z9Pe|njNj4Mh>4QVxL^^?$yn}n#Z2fZFZZb+<3-UbnI;Vmz^HHaCV{ab`$-wH)058`MKJZ|`}WO-cSkqak}2-+D&XF8 zKtxM#IbM}yxyT>@v(ke0^XU#1UKaAQFT1YN7QgK3qJ4WCtKtPHU#kl8-rfz&o zkoh?f?x<``iuS?O9T*f!nGn=nIokq)==OY+H=lG6bSE|3zk(p+bq9{@Igr2ycWajE z|L6yM;`f!E$K}EbRBtO8`PUNjke!v?k~PSl&n=3`=tB4;ob*StshSl;b~A~ddTCG2Qx6O)f-Q_#tix-&gp6Y0Vk^=h4dYAKyrSXO0 z&AOA}j`!AD0?Ux32YxqR_r_gv!@#E`>7t?(2X2ZT!;#cc7D64p)}-%$z7L#sx73D* zvb%?3$H}@20mg^?cA2|dnLkC!DeR6Y$cIIdrqE2cSgk<8QL_|%w@Nbx`3gfl0n^wd zRXxt?F~)uTLZtbL^58ccu_9Wl-vkD)ofe - - - Add e-mail address to Yivi app - - - - -

Click the link to add the e-mail address to your Yivi app.

-

- Add e-mail address to your Yivi app -

- - - + + + + + + + \ No newline at end of file diff --git a/src/main/resources/email-nl.html b/src/main/resources/email-nl.html index 7ac157f..103d21a 100644 --- a/src/main/resources/email-nl.html +++ b/src/main/resources/email-nl.html @@ -1,16 +1,81 @@ - - - Voeg e-mailadres toe aan Yivi-app - - - - -

Klik op de link om het e-mailadres toe te voegen aan je Yivi-app.

-

- Voeg e-mailadres toe aan je Yivi-app -

- - - + + + + + + + \ No newline at end of file From 32b34da4b5adbd9b81911e49da25c920743acbe6 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Wed, 11 Dec 2024 10:39:31 +0100 Subject: [PATCH 02/24] added a second url var --- src/main/java/foundation/privacybydesign/email/EmailRestApi.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/foundation/privacybydesign/email/EmailRestApi.java b/src/main/java/foundation/privacybydesign/email/EmailRestApi.java index 3bacbe8..6a2e7cb 100644 --- a/src/main/java/foundation/privacybydesign/email/EmailRestApi.java +++ b/src/main/java/foundation/privacybydesign/email/EmailRestApi.java @@ -84,6 +84,7 @@ public Response sendEmail(@FormParam("email") String email, client.getEmail(lang), client.getReplyToEmail(), true, + url, url ); } catch (AddressException e) { From 2d97481d6874772096e2f226ff222e056ff39012 Mon Sep 17 00:00:00 2001 From: saravahdatipour Date: Wed, 11 Dec 2024 11:02:46 +0100 Subject: [PATCH 03/24] debugging --- .../java/foundation/privacybydesign/email/EmailRestApi.java | 2 +- src/main/resources/email-en.html | 4 ++-- src/main/resources/email-nl.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/foundation/privacybydesign/email/EmailRestApi.java b/src/main/java/foundation/privacybydesign/email/EmailRestApi.java index 6a2e7cb..59485b4 100644 --- a/src/main/java/foundation/privacybydesign/email/EmailRestApi.java +++ b/src/main/java/foundation/privacybydesign/email/EmailRestApi.java @@ -85,7 +85,7 @@ public Response sendEmail(@FormParam("email") String email, client.getReplyToEmail(), true, url, - url + ); } catch (AddressException e) { logger.error("Invalid address: {}", e.getMessage()); diff --git a/src/main/resources/email-en.html b/src/main/resources/email-en.html index fb55467..b3416ad 100644 --- a/src/main/resources/email-en.html +++ b/src/main/resources/email-en.html @@ -28,14 +28,14 @@