From fbf88690c402ab72b74e872b3b0f291893f63805 Mon Sep 17 00:00:00 2001 From: romanetar Date: Thu, 4 Jun 2026 15:36:18 +0200 Subject: [PATCH] feat: verification email style update Signed-off-by: romanetar --- .github/workflows/pull_request_unit_tests.yml | 2 + .github/workflows/push.yml | 2 + .../email_verification_request_fn.blade.php | 53 +++++++-------- tests/unit/EmailVerificationViewTest.php | 65 +++++++++++++++++++ 4 files changed, 96 insertions(+), 26 deletions(-) create mode 100644 tests/unit/EmailVerificationViewTest.php diff --git a/.github/workflows/pull_request_unit_tests.yml b/.github/workflows/pull_request_unit_tests.yml index 462317c3..9b21c15e 100644 --- a/.github/workflows/pull_request_unit_tests.yml +++ b/.github/workflows/pull_request_unit_tests.yml @@ -37,6 +37,8 @@ jobs: PHP_VERSION: 8.3 OTEL_SDK_DISABLED: true OTEL_SERVICE_ENABLED: false + MAIL_FROM_EMAIL: noreply@tipit.net + MAIL_FROM_NAME: noreply@tipit.net services: mysql: image: mysql:8.0 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ad2ede65..cfaf33c5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,6 +33,8 @@ jobs: PHP_VERSION: 8.3 OTEL_SDK_DISABLED: true OTEL_SERVICE_ENABLED: false + MAIL_FROM_EMAIL: noreply@tipit.net + MAIL_FROM_NAME: noreply@tipit.net services: mysql: image: mysql:8.0 diff --git a/resources/views/emails/auth/email_verification_request_fn.blade.php b/resources/views/emails/auth/email_verification_request_fn.blade.php index be46ec63..11b56ad5 100644 --- a/resources/views/emails/auth/email_verification_request_fn.blade.php +++ b/resources/views/emails/auth/email_verification_request_fn.blade.php @@ -1,33 +1,34 @@ @extends('emails.email_layout') @section('content') - +
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
- -
-
Please click the link below to verify your email address.
-
- -
-
If you did not create an {!! Config::get('app.app_name') !!} account, no further action is required.
-
-
Thanks!

{{Config::get('app.tenant_name')}} Support Team
-
+

Confirm your email.

+

Verify {{ $user_email }} to finish setting up your FNid.

+
+ Verify email → +
+

Or paste this link into your browser:
{{ $verification_link }}

+
+

Didn't sign up for an {!! Config::get('app.app_name') !!} account? You can ignore this email — your account will be inactive without verification.

+
+ Questions? {!! Config::get('app.help_email') !!} +
@stop \ No newline at end of file diff --git a/tests/unit/EmailVerificationViewTest.php b/tests/unit/EmailVerificationViewTest.php new file mode 100644 index 00000000..7568879b --- /dev/null +++ b/tests/unit/EmailVerificationViewTest.php @@ -0,0 +1,65 @@ +createMock(User::class); + $user->method('getEmail')->willReturn($email); + $user->method('getFullName')->willReturn('Preview User'); + return $user; + } + + public function testFnVerificationEmailRendersAndSends(): void + { + Config::set('app.tenant_name', 'FNTECH'); + + $email = 'preview+fntech@example.com'; + $verificationLink = 'https://id.fntech.com/verify/abc123deadbeef'; + + $mailable = new UserEmailVerificationRequest($this->makeUser($email), $verificationLink); + + $mailable->assertHasSubject( + sprintf('[%s] Email verification required', Config::get('app.app_name')) + ); + $mailable->assertTo($email); + + $html = $mailable->render(); + + $this->assertStringContainsString('Confirm your email.', $html); + $this->assertStringContainsString($email, $html); + $this->assertStringContainsString($verificationLink, $html); + $this->assertStringContainsString('Verify email', $html); + $this->assertStringContainsString('paste this link', $html); + $this->assertStringContainsString('Questions?', $html); + $this->assertStringContainsString(Config::get('app.help_email'), $html); + $this->assertStringNotContainsString('edit your profile', $html); + } +}