Skip to content

Commit d07947c

Browse files
committed
feat: verification email style update
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 08712ec commit d07947c

4 files changed

Lines changed: 97 additions & 26 deletions

File tree

.github/workflows/pull_request_unit_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
PHP_VERSION: 8.3
3838
OTEL_SDK_DISABLED: true
3939
OTEL_SERVICE_ENABLED: false
40+
MAIL_FROM_EMAIL: noreply@tipit.net
41+
MAIL_FROM_NAME: noreply@tipit.net
4042
services:
4143
mysql:
4244
image: mysql:8.0

.github/workflows/push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
PHP_VERSION: 8.3
3434
OTEL_SDK_DISABLED: true
3535
OTEL_SERVICE_ENABLED: false
36+
MAIL_FROM_EMAIL: noreply@tipit.net
37+
MAIL_FROM_NAME: noreply@tipit.net
3638
services:
3739
mysql:
3840
image: mysql:8.0
Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
@extends('emails.email_layout')
22

33
@section('content')
4-
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:middle;" width="100%">
4+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
55
<tbody>
6-
<tr>
7-
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;">
8-
<div style="font-family:open Sans Helvetica, Arial, sans-serif;font-size:16px;line-height:1;text-align:center;color:#000000;">Dear <a href="#" style="text-decoration:none !important;color:black !important; cursor:default !important">{!!$user_email!!}</a>,</div>
9-
</td>
10-
</tr>
11-
<tr>
12-
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
13-
<div style="font-family:open Sans Helvetica, Arial, sans-serif;font-size:16px;line-height:1;text-align:center;color:#000000;">Please click the link below to verify your email address.</div>
14-
</td>
15-
</tr>
16-
<tr>
17-
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:16px;padding-left:25px;word-break:break-word;">
18-
<div style="font-family:open Sans Helvetica, Arial, sans-serif;font-size:16px;line-height:1;text-align:center;color:#000000;"><a href="{!! $verification_link !!}" target="_blank">Verify Email Address.</a></div>
19-
</td>
20-
</tr>
21-
<tr>
22-
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
23-
<div style="font-family:open Sans Helvetica, Arial, sans-serif;font-size:16px;line-height:1;text-align:center;color:#000000;">If you did not create an {!! Config::get('app.app_name') !!} account, no further action is required.</div>
24-
</td>
25-
</tr>
26-
<tr>
27-
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;">
28-
<div style="font-family:open Sans Helvetica, Arial, sans-serif;font-size:16px;line-height:1;text-align:center;color:#000000;">Thanks! <br/><br/>{{Config::get('app.tenant_name')}} Support Team</div>
29-
</td>
30-
</tr>
6+
<tr>
7+
<td style="padding: 24px 40px 8px;">
8+
<h1 style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 500; margin: 0 0 8px; color: #0A0A0A; letter-spacing: -0.01em;">Confirm your email.</h1>
9+
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 15px; color: #5F5E5A; margin: 0 0 28px; line-height: 1.6;">Verify <span style="font-family: 'Courier New', monospace; font-size: 14px; color: #0A0A0A;">{!!$user_email!!}</span> to finish setting up your FNid.</p>
10+
</td>
11+
</tr>
12+
<tr>
13+
<td style="padding: 0 40px 28px;">
14+
<a href="{!! $verification_link !!}" target="_blank" style="display: inline-block; background: #0A0A0A; color: #FFFFFF; text-decoration: none; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 500; padding: 11px 22px; border-radius: 6px;">Verify email &rarr;</a>
15+
</td>
16+
</tr>
17+
<tr>
18+
<td style="padding: 0 40px 28px;">
19+
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 13px; color: #888780; margin: 0; line-height: 1.6;">Or paste this link into your browser:<br><span style="font-family: 'Courier New', monospace; font-size: 12px; color: #5F5E5A; word-break: break-all;">{!! $verification_link !!}</span></p>
20+
</td>
21+
</tr>
22+
<tr>
23+
<td style="padding: 0 40px 24px; border-top: 1px solid #E5E4DE;">
24+
<p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 13px; color: #5F5E5A; margin: 20px 0 0; line-height: 1.6;">Didn't sign up for an {!! Config::get('app.app_name') !!} account? You can ignore this email &mdash; your account will be inactive without verification.</p>
25+
</td>
26+
</tr>
27+
<tr>
28+
<td style="background: #F5F4EF; padding: 20px 40px; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 13px; color: #5F5E5A; text-align: center;">
29+
Questions? <a href="mailto:{!! Config::get('app.help_email') !!}" style="color: #0C64C8; text-decoration: none;">{!! Config::get('app.help_email') !!}</a>
30+
</td>
31+
</tr>
3132
</tbody>
3233
</table>
3334
@stop
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php namespace Tests\unit;
2+
3+
/**
4+
* Copyright 2026 OpenStack Foundation
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
**/
15+
16+
use App\Mail\UserEmailVerificationRequest;
17+
use Auth\User;
18+
use Illuminate\Support\Facades\Config;
19+
use Illuminate\Support\Facades\Mail;
20+
use Illuminate\Support\Facades\Queue;
21+
use Tests\BrowserKitTestCase;
22+
23+
class EmailVerificationViewTest extends BrowserKitTestCase
24+
{
25+
protected function prepareForTests(): void
26+
{
27+
$_SERVER['HTTP_CLIENT_IP'] = '127.0.0.1';
28+
Queue::fake();
29+
Mail::fake();
30+
}
31+
32+
private function makeUser(string $email): User
33+
{
34+
$user = $this->createMock(User::class);
35+
$user->method('getEmail')->willReturn($email);
36+
$user->method('getFullName')->willReturn('Preview User');
37+
return $user;
38+
}
39+
40+
public function testFnVerificationEmailRendersAndSends(): void
41+
{
42+
Config::set('app.tenant_name', 'FNTECH');
43+
44+
$email = 'preview+fntech@example.com';
45+
$verificationLink = 'https://id.fntech.com/verify/abc123deadbeef';
46+
47+
$mailable = new UserEmailVerificationRequest($this->makeUser($email), $verificationLink);
48+
49+
$mailable->assertHasSubject(
50+
sprintf('[%s] Email verification required', Config::get('app.app_name'))
51+
);
52+
$mailable->assertTo($email);
53+
54+
$html = $mailable->render();
55+
56+
$this->assertStringContainsString('Confirm your email.', $html);
57+
$this->assertStringContainsString($email, $html);
58+
$this->assertStringContainsString($verificationLink, $html);
59+
$this->assertStringContainsString('Verify email', $html);
60+
$this->assertStringContainsString('paste this link', $html);
61+
// _fn footer shows tenant support team, not an arbitrary help email
62+
$this->assertStringContainsString('Questions?', $html);
63+
// _fn view has no profile-edit section
64+
$this->assertStringNotContainsString('edit your profile', $html);
65+
}
66+
}

0 commit comments

Comments
 (0)