Skip to content

Commit b5ecaa1

Browse files
committed
#549 Fix invitation email gmail
1 parent 08274a6 commit b5ecaa1

File tree

3 files changed

+119
-71
lines changed

3 files changed

+119
-71
lines changed

server/src/main/resources/templates/invitation_en.html

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<title>{{title}}</title>
55
</head>
66
<body>
7-
<div class="main" style="width:617px;margin: 0 auto;display:flex;flex-direction:column; padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
7+
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
88
<div class="header">
99
{{#institutionLogoUrl}}
10-
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
10+
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
1111
{{/institutionLogoUrl}}
1212
{{#isInstitutionSurf}}
13-
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
13+
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
1414
{{/isInstitutionSurf}}
1515
</div>
1616
<div class="head">
@@ -41,47 +41,59 @@
4141
</div>
4242
{{/message}}
4343
{{#useEduID}}
44-
<p>You accept the role(s) by logging in with eduID. If you don’t have one yet, you can create it right away.</p>
45-
<div style="display: flex;">
46-
<a class="button" href="{{{ url }}}"
47-
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
48-
{{> eduID-logo-square.svg}}
49-
<span style="color: white;margin: auto 0 auto 12px;">Continue with eduID</span>
50-
</a>
51-
</div>
44+
<p>You accept the role(s) by logging in with eduID. If you don't have one yet, you can create it right away.</p>
45+
<table style="border-collapse: collapse; margin: 10px 0;">
46+
<tr>
47+
<td style="border-radius: 4px; background-color: #0077c8; padding: 0; line-height: 0;">
48+
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px 8px 10px">
49+
<table style="border-collapse: collapse;">
50+
<tr>
51+
<td style="vertical-align: middle; padding: 0;">
52+
{{> eduID-logo-square.svg}}
53+
</td>
54+
<td style="vertical-align: middle; padding-left: 12px;">
55+
<span style="color: white;">Continue with eduID</span>
56+
</td>
57+
</tr>
58+
</table>
59+
</a>
60+
</td>
61+
</tr>
62+
</table>
5263
<p style="word-break: break-word">or copy this link into your browser: {{{ url }}}</p>
5364
{{/useEduID}}
5465
{{^useEduID}}
5566
<p>You accept the role(s) by logging in with SURFconext.</p>
56-
<div style="display: flex;">
57-
<a class="button" href="{{{ url }}}"
58-
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
59-
<span style="color: white;margin: auto;">Continue</span>
60-
</a>
61-
</div>
67+
<table style="border-collapse: collapse; margin: 10px 0;">
68+
<tr>
69+
<td style="border-radius: 4px; background-color: #0077c8; padding: 0;">
70+
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px;">
71+
<span style="color: white;">Continue</span>
72+
</a>
73+
</td>
74+
</tr>
75+
</table>
6276
<p style="word-break: break-word">or copy this link into your browser: {{{ url }}}</p>
6377
{{/useEduID}}
6478
</div>
65-
<div class="footer"
66-
style="display:flex;align-items:center;justify-content:space-between;padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
67-
<div class="links" style="text-align: left">
68-
<span>This invitation is sent via</span>
69-
<a class="external" href="https://support.surfconext.nl/invite"
70-
style="color: #636363;">SURFconext Invite</a>
71-
<span></span>
72-
<a class="external" href="https://support.surfconext.nl/privacy"
73-
style="color: #636363;">Privacy Policy</a>
74-
<span></span>
75-
<a class="external" href="https://support.surfconext.nl/terms-en"
76-
style="color: #636363;">Terms of Use</a>
77-
</div>
78-
<div class="about" style="text-align: right">
79-
<a class="external"
80-
href="https://surf.nl/"
81-
>{{> logo-surf-black.svg}}</a>
82-
</div>
79+
<div class="footer" style="padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
80+
<table style="width: 100%; border-collapse: collapse;">
81+
<tr>
82+
<td style="text-align: left; vertical-align: middle; padding-right: 10px; line-height: 0;">
83+
<span>This invitation is sent via</span>
84+
<a class="external" href="https://support.surfconext.nl/invite" style="color: #636363; text-decoration: underline;">SURFconext Invite</a>
85+
<span></span>
86+
<a class="external" href="https://support.surfconext.nl/privacy" style="color: #636363; text-decoration: underline;">Privacy Policy</a>
87+
<span></span>
88+
<a class="external" href="https://support.surfconext.nl/terms-en" style="color: #636363; text-decoration: underline;">Terms of Use</a>
89+
</td>
90+
<td style="text-align: right; vertical-align: middle; white-space: nowrap; width: 100px; line-height: 0;">
91+
<a class="external" href="https://surf.nl/">{{> logo-surf-black.svg}}</a>
92+
</td>
93+
</tr>
94+
</table>
8395
</div>
8496
</div>
8597

8698
</body>
87-
</html>
99+
</html>

server/src/main/resources/templates/invitation_nl.html

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
<title>{{title}}</title>
55
</head>
66
<body>
7-
<div class="main" style="width:617px;margin: 0 auto;display:flex;flex-direction:column; padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
7+
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
8+
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
89
<div class="header">
910
{{#institutionLogoUrl}}
10-
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
11+
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
1112
{{/institutionLogoUrl}}
1213
{{#isInstitutionSurf}}
13-
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
14+
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
1415
{{/isInstitutionSurf}}
1516
</div>
1617
<div class="head">
@@ -42,46 +43,58 @@
4243
{{/message}}
4344
{{#useEduID}}
4445
<p>De rol(len) accepteer je door in te loggen met eduID. Als je deze nog niet hebt, kun je hem gelijk aanmaken.</p>
45-
<div style="display: flex;">
46-
<a class="button" href="{{{ url }}}"
47-
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
48-
{{> eduID-logo-square.svg}}
49-
<span style="color: white;margin: auto 0 auto 12px;">Ga door met eduID</span>
50-
</a>
51-
</div>
46+
<table style="border-collapse: collapse; margin: 10px 0;">
47+
<tr>
48+
<td style="border-radius: 4px; background-color: #0077c8; padding: 0; line-height: 0;">
49+
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px 8px 10px">
50+
<table style="border-collapse: collapse;">
51+
<tr>
52+
<td style="vertical-align: middle; padding: 0;">
53+
{{> eduID-logo-square.svg}}
54+
</td>
55+
<td style="vertical-align: middle; padding-left: 12px;">
56+
<span style="color: white;">Ga door met eduID</span>
57+
</td>
58+
</tr>
59+
</table>
60+
</a>
61+
</td>
62+
</tr>
63+
</table>
5264
<p style="word-break: break-word">of kopieer deze link in je browser: {{{ url }}}</p>
5365
{{/useEduID}}
5466
{{^useEduID}}
5567
<p>De rol(len) accepteer je door in te loggen met SURFconext.</p>
56-
<div style="display: flex;">
57-
<a class="button" href="{{{ url }}}"
58-
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
59-
<span style="color: white;margin: auto;">Ga door</span>
60-
</a>
61-
</div>
68+
<table style="border-collapse: collapse; margin: 10px 0;">
69+
<tr>
70+
<td style="border-radius: 4px; background-color: #0077c8; padding: 0;">
71+
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px;">
72+
<span style="color: white;">Ga door</span>
73+
</a>
74+
</td>
75+
</tr>
76+
</table>
6277
<p style="word-break: break-word">of kopieer deze link in je browser: {{{ url }}}</p>
6378
{{/useEduID}}
6479
</div>
65-
<div class="footer"
66-
style="display:flex;align-items:center;justify-content:space-between;padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
67-
<div class="links" style="text-align: left">
68-
<span>Deze uitnoding verloopt via</span>
69-
<a class="external" href="https://support.surfconext.nl/invite"
70-
style="color: #636363;">SURFconext Invite</a>
71-
<span></span>
72-
<a class="external" href="https://support.surfconext.nl/privacy-nl"
73-
style="color: #636363;">Privacy Policy</a>
74-
<span></span>
75-
<a class="external" href="https://support.surfconext.nl/terms-nl"
76-
style="color: #636363;">Voorwaarden</a>
77-
</div>
78-
<div class="about" style="text-align: right">
79-
<a class="external"
80-
href="https://surf.nl/"
81-
>{{> logo-surf-black.svg}}</a>
82-
</div>
80+
<div class="footer" style="padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
81+
<table style="width: 100%; border-collapse: collapse;">
82+
<tr>
83+
<td style="text-align: left; vertical-align: middle; padding-right: 10px; line-height: 0;">
84+
<span>Deze uitnoding verloopt via</span>
85+
<a class="external" href="https://support.surfconext.nl/invite" style="color: #636363; text-decoration: underline;">SURFconext Invite</a>
86+
<span></span>
87+
<a class="external" href="https://support.surfconext.nl/privacy-nl" style="color: #636363; text-decoration: underline;">Privacy Policy</a>
88+
<span></span>
89+
<a class="external" href="https://support.surfconext.nl/terms-nl" style="color: #636363; text-decoration: underline;">Voorwaarden</a>
90+
</td>
91+
<td style="text-align: right; vertical-align: middle; white-space: nowrap; width: 100px; line-height: 0;">
92+
<a class="external" href="https://surf.nl/">{{> logo-surf-black.svg}}</a>
93+
</td>
94+
</tr>
95+
</table>
8396
</div>
8497
</div>
8598

8699
</body>
87-
</html>
100+
</html>

server/src/test/java/invite/api/InvitationControllerTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,29 @@ void resendInviteMailExpirationDate() throws Exception {
748748
assertTrue(savedInvitation.getExpiryDate().isAfter(Instant.now().plus(13, ChronoUnit.DAYS)));
749749
}
750750

751+
@Test
752+
void resendInviteMailExpirationDateNL() throws Exception {
753+
AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", INVITER_SUB);
754+
Invitation invitation = invitationRepository.findByHash(Authority.GUEST.name()).get();
755+
invitation.setExpiryDate(Instant.now().minus(5, ChronoUnit.DAYS));
756+
invitation.setLanguage(Language.nl);
757+
invitationRepository.save(invitation);
758+
759+
super.stubForManageProviderById(EntityType.OIDC10_RP, "5");
760+
given()
761+
.when()
762+
.filter(accessCookieFilter.cookieFilter())
763+
.accept(ContentType.JSON)
764+
.header(accessCookieFilter.csrfToken().getHeaderName(), accessCookieFilter.csrfToken().getToken())
765+
.contentType(ContentType.JSON)
766+
.pathParam("id", invitation.getId())
767+
.put("/api/v1/invitations/{id}")
768+
.then()
769+
.statusCode(201);
770+
Invitation savedInvitation = invitationRepository.findByHash(Authority.GUEST.name()).get();
771+
assertTrue(savedInvitation.getExpiryDate().isAfter(Instant.now().plus(13, ChronoUnit.DAYS)));
772+
}
773+
751774
@Test
752775
void invitationsSearchSuperUser() throws Exception {
753776
AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", SUPER_SUB);

0 commit comments

Comments
 (0)