-
Notifications
You must be signed in to change notification settings - Fork 0
feat: verification confirmation email style update #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
romanetar
wants to merge
1
commit into
main
Choose a base branch
from
feature/verification-confirmation-email-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+168
−23
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 69 additions & 23 deletions
92
resources/views/emails/auth/email_verification_request_success.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,79 @@ | ||
| @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;">Your {!! Config::get('app.app_name') !!} <b><a href="#" style="text-decoration:none !important;color:black !important; cursor:default !important">{!!$user_email!!}</a></b> has been successfully verified.</div> | ||
| </td> | ||
| </tr> | ||
|
|
||
| @if(!empty($reset_password_link)) | ||
| <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;">Remember, if you need to set a password, you may do so <a href="{!! $reset_password_link !!}" target="_blank">here</a> (link expires in {!! $reset_password_link_lifetime !!} minutes).</div> | ||
| <td style="padding: 24px 40px 8px;"> | ||
| <table border="0" cellpadding="0" cellspacing="0" role="presentation"> | ||
| <tbody> | ||
| <tr> | ||
| <td style="vertical-align: middle; width: 38px; padding-right: 10px;"> | ||
| <div style="width: 28px; height: 28px; border-radius: 50%; background: #1D9E75; text-align: center; line-height: 28px; font-size: 16px; color: #FFFFFF; font-weight: 700;">✓</div> | ||
| </td> | ||
| <td style="vertical-align: middle;"> | ||
| <h1 style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 500; margin: 0; color: #0A0A0A; letter-spacing: -0.01em;">You're verified.</h1> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| <p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 15px; color: #5F5E5A; margin: 12px 0 24px; line-height: 1.6;"><span style="font-family: 'Courier New', monospace; font-size: 14px; color: #0A0A0A;">{{ $user_email }}</span> is now your {!! Config::get('app.app_name') !!}.</p> | ||
| </td> | ||
| </tr> | ||
| @if(!empty($reset_password_link) || !$user_is_complete) | ||
| <tr> | ||
| <td style="padding: 0 40px 20px;"> | ||
| <p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; color: #5F5E5A; margin: 0; line-height: 1.6;"> | ||
| {{ !empty($reset_password_link) && !$user_is_complete ? 'Two quick things to finish setup:' : 'One quick thing to finish setup:' }} | ||
| </p> | ||
| </td> | ||
| </tr> | ||
| @endif | ||
| @if(!empty($reset_password_link)) | ||
| <tr> | ||
| <td style="padding: 0 40px 32px;"> | ||
| <table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"> | ||
| <tbody> | ||
| <tr> | ||
| <td style="vertical-align: top; width: 32px; padding-right: 10px;"> | ||
| <div style="width: 22px; height: 22px; border-radius: 50%; background: #E6F1FB; color: #0C64C8; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 500; text-align: center; line-height: 22px;">1</div> | ||
| </td> | ||
| <td> | ||
| <div style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 500; color: #0A0A0A; margin-bottom: 4px;">Set your password</div> | ||
| <p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; color: #5F5E5A; margin: 0 0 12px; line-height: 1.6;">Link expires in {!! $reset_password_link_lifetime !!} minutes.</p> | ||
| <a href="{!! $reset_password_link !!}" target="_blank" style="display: inline-block; background: #0A0A0A; color: #FFFFFF; text-decoration: none; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 500; padding: 9px 18px; border-radius: 6px;">Set password →</a> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| </td> | ||
| </tr> | ||
| @endif | ||
| @if(!$user_is_complete) | ||
| <tr> | ||
| <td style="padding: 0 40px 32px;"> | ||
| <table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"> | ||
| <tbody> | ||
| <tr> | ||
| <td style="vertical-align: top; width: 32px; padding-right: 10px;"> | ||
| <div style="width: 22px; height: 22px; border-radius: 50%; background: #E6F1FB; color: #0C64C8; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 500; text-align: center; line-height: 22px;">{{ !empty($reset_password_link) ? '2' : '1' }}</div> | ||
| </td> | ||
| <td> | ||
| <div style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 500; color: #0A0A0A; margin-bottom: 4px;">Complete your profile</div> | ||
| <p style="font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; color: #5F5E5A; margin: 0 0 12px; line-height: 1.6;">Add your name, company, and country. Photo and bio optional.</p> | ||
| <a href="{!! URL::action("UserController@getLogin") !!}" target="_blank" style="display: inline-block; background: transparent; color: #0A0A0A; text-decoration: none; font-family: 'Open Sans', Helvetica, Arial, sans-serif; font-size: 14px; font-weight: 500; padding: 8px 17px; border-radius: 6px; border: 1px solid #B4B2A9;">Open profile →</a> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| </td> | ||
| </tr> | ||
| @endif | ||
| <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> | ||
| @endif | ||
| @if(!$user_is_complete) | ||
| <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;">You may enter your profile details <a href="{!! URL::action("UserController@getLogin") !!}" target="_blank">here</a>.</div> | ||
| </td> | ||
| </tr> | ||
| @endif | ||
| <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;">If you need further assistance please email <a href="mailto:{!! Config::get('app.help_email') !!}">{!! Config::get('app.help_email') !!}</a>.</div> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| @stop | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| <?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\UserEmailVerificationSuccess; | ||
| use Auth\User; | ||
| use Illuminate\Support\Facades\Config; | ||
| use Illuminate\Support\Facades\Mail; | ||
| use Illuminate\Support\Facades\Queue; | ||
| use Tests\BrowserKitTestCase; | ||
|
|
||
| class EmailVerificationSuccessViewTest extends BrowserKitTestCase | ||
| { | ||
| protected function prepareForTests(): void | ||
| { | ||
| $_SERVER['HTTP_CLIENT_IP'] = '127.0.0.1'; | ||
| Queue::fake(); | ||
| Mail::fake(); | ||
| } | ||
|
|
||
| private function makeUser(string $email, bool $complete): User | ||
| { | ||
| $user = $this->createMock(User::class); | ||
| $user->method('getEmail')->willReturn($email); | ||
| $user->method('getFullName')->willReturn('Preview User'); | ||
| $user->method('getFirstName')->willReturn($complete ? 'Preview' : null); | ||
| $user->method('getLastName')->willReturn($complete ? 'User' : null); | ||
| $user->method('getCompany')->willReturn($complete ? 'ACME Inc.' : null); | ||
| $user->method('getCountry')->willReturn($complete ? 'US' : null); | ||
| return $user; | ||
| } | ||
|
|
||
| public function testVerificationSuccessWithPasswordLinkAndIncompleteProfile(): void | ||
| { | ||
| $email = 'preview+verified@example.com'; | ||
| $resetLink = 'https://id.fntech.com/reset/abc123deadbeef'; | ||
|
|
||
| $mailable = new UserEmailVerificationSuccess($this->makeUser($email, false), $resetLink); | ||
|
|
||
| $mailable->assertHasSubject( | ||
| sprintf('[%1$s] %1$s Verified', Config::get('app.app_name')) | ||
| ); | ||
| $mailable->assertTo($email); | ||
|
|
||
| $html = $mailable->render(); | ||
|
|
||
| $this->assertStringContainsString("You're verified.", $html); | ||
| $this->assertStringContainsString($email, $html); | ||
| $this->assertStringContainsString(Config::get('app.app_name'), $html); | ||
| // Both steps present | ||
| $this->assertStringContainsString('Two quick things to finish setup', $html); | ||
| $this->assertStringContainsString('Set your password', $html); | ||
| $this->assertStringContainsString($resetLink, $html); | ||
| $this->assertStringContainsString('Complete your profile', $html); | ||
| $this->assertStringContainsString('Open profile', $html); | ||
| // Footer | ||
| $this->assertStringContainsString(Config::get('app.help_email'), $html); | ||
|
|
||
| } | ||
|
|
||
| public function testVerificationSuccessWithoutPasswordLinkAndCompleteProfile(): void | ||
| { | ||
| $email = 'preview+verified-complete@example.com'; | ||
|
|
||
| $mailable = new UserEmailVerificationSuccess($this->makeUser($email, true), null); | ||
|
|
||
| $mailable->assertHasSubject( | ||
| sprintf('[%1$s] %1$s Verified', Config::get('app.app_name')) | ||
| ); | ||
| $mailable->assertTo($email); | ||
|
|
||
| $html = $mailable->render(); | ||
|
|
||
| $this->assertStringContainsString("You're verified.", $html); | ||
| $this->assertStringContainsString($email, $html); | ||
| // No steps — intro paragraph should be absent | ||
| $this->assertStringNotContainsString('Two quick things to finish setup', $html); | ||
| $this->assertStringNotContainsString('Set your password', $html); | ||
| $this->assertStringNotContainsString('Complete your profile', $html); | ||
| // Footer always present | ||
| $this->assertStringContainsString(Config::get('app.help_email'), $html); | ||
|
|
||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.