Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/pull_request_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 27 additions & 26 deletions resources/views/emails/auth/email_verification_request_fn.blade.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
@extends('emails.email_layout')

@section('content')
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:middle;" width="100%">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
<tbody>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;">
<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>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<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>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:16px;padding-left:25px;word-break:break-word;">
<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>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<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>
</td>
</tr>
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;">
<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>
</td>
</tr>
<tr>
<td style="padding: 24px 40px 8px;">
<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>
Comment thread
romanetar marked this conversation as resolved.
<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>
</td>
</tr>
<tr>
<td style="padding: 0 40px 28px;">
<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>
</td>
</tr>
<tr>
<td style="padding: 0 40px 28px;">
<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>
</td>
</tr>
<tr>
<td style="padding: 0 40px 24px; border-top: 1px solid #E5E4DE;">
<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>
</td>
</tr>
<tr>
<td style="background: #F5F4EF; padding: 20px 40px; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 13px; color: #5F5E5A; text-align: center;">
Questions? <a href="mailto:{!! Config::get('app.help_email') !!}" style="color: #0C64C8; text-decoration: none;">{!! Config::get('app.help_email') !!}</a>
</td>
</tr>
</tbody>
</table>
@stop
65 changes: 65 additions & 0 deletions tests/unit/EmailVerificationViewTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php namespace Tests\unit;

/**
* Copyright 2026 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

use App\Mail\UserEmailVerificationRequest;
use Auth\User;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Queue;
use Tests\BrowserKitTestCase;

class EmailVerificationViewTest extends BrowserKitTestCase
{
protected function prepareForTests(): void
{
$_SERVER['HTTP_CLIENT_IP'] = '127.0.0.1';
Queue::fake();
Mail::fake();
}

private function makeUser(string $email): User
{
$user = $this->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);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
$this->assertStringContainsString(Config::get('app.help_email'), $html);
$this->assertStringNotContainsString('edit your profile', $html);
}
}
Loading