-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added registration and forgot password notifications
- Loading branch information
1 parent
761d4e6
commit 18217ff
Showing
21 changed files
with
614 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 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,57 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use App\User; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class ForgotPassword extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
private User $user; | ||
private string $token; | ||
|
||
public function __construct(User $user, string $token) | ||
{ | ||
$this->user = $user; | ||
$this->token = $token; | ||
} | ||
|
||
public function via($notifiable) | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Get the mail representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return \Illuminate\Notifications\Messages\MailMessage | ||
*/ | ||
public function toMail($notifiable) | ||
{ | ||
return (new MailMessage) | ||
->subject('Costs to Expect API: Reset password') | ||
->greeting('Hi,') | ||
->line('We have received a request to reset your password, if this we you please follow the steps below, if this was not you, please ignore this email and let us know.') | ||
->line("To create a new password please POST `password` and `password_confirmation` to " . url('/v2/auth/create-new-password?email=' . urlencode($this->user->email) . '&token=' . urlencode($this->token))) | ||
->line('Thank you for using the Costs to Expect API.'); | ||
} | ||
|
||
/** | ||
* Get the array representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
public function toArray($notifiable) | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
This file contains 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 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,19 @@ | ||
<table class="action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td align="center"> | ||
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td align="center"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td> | ||
<a href="{{ $url }}" class="button button-{{ $color ?? 'primary' }}" target="_blank" rel="noopener">{{ $slot }}</a> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> |
This file contains 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,11 @@ | ||
<tr> | ||
<td> | ||
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td class="content-cell" align="center"> | ||
{{ Illuminate\Mail\Markdown::parse($slot) }} | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> |
This file contains 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,11 @@ | ||
<tr> | ||
<td class="header"> | ||
<a href="{{ $url }}" style="display: inline-block;"> | ||
@if (trim($slot) === 'Laravel') | ||
<img src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Logo"> | ||
@else | ||
{{ $slot }} | ||
@endif | ||
</a> | ||
</td> | ||
</tr> |
This file contains 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,56 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<meta name="color-scheme" content="light"> | ||
<meta name="supported-color-schemes" content="light"> | ||
</head> | ||
<body> | ||
<style> | ||
@media only screen and (max-width: 600px) { | ||
.inner-body { | ||
width: 100% !important; | ||
} | ||
.footer { | ||
width: 100% !important; | ||
} | ||
} | ||
@media only screen and (max-width: 500px) { | ||
.button { | ||
width: 100% !important; | ||
} | ||
} | ||
</style> | ||
|
||
<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td align="center"> | ||
<table class="content" width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
{{ $header ?? '' }} | ||
|
||
<!-- Email Body --> | ||
<tr> | ||
<td class="body" width="100%" cellpadding="0" cellspacing="0"> | ||
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation"> | ||
<!-- Body content --> | ||
<tr> | ||
<td class="content-cell"> | ||
{{ Illuminate\Mail\Markdown::parse($slot) }} | ||
|
||
{{ $subcopy ?? '' }} | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
|
||
{{ $footer ?? '' }} | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |
This file contains 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,27 @@ | ||
@component('mail::layout') | ||
{{-- Header --}} | ||
@slot('header') | ||
@component('mail::header', ['url' => config('app.url')]) | ||
Costs to Expect | ||
@endcomponent | ||
@endslot | ||
|
||
{{-- Body --}} | ||
{{ $slot }} | ||
|
||
{{-- Subcopy --}} | ||
@isset($subcopy) | ||
@slot('subcopy') | ||
@component('mail::subcopy') | ||
{{ $subcopy }} | ||
@endcomponent | ||
@endslot | ||
@endisset | ||
|
||
{{-- Footer --}} | ||
@slot('footer') | ||
@component('mail::footer') | ||
© {{ date('Y') }} Costs to Expect and Dean Blackborough. @lang('All rights reserved.') | ||
@endcomponent | ||
@endslot | ||
@endcomponent |
This file contains 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,14 @@ | ||
<table class="panel" width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td class="panel-content"> | ||
<table width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td class="panel-item"> | ||
{{ Illuminate\Mail\Markdown::parse($slot) }} | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
|
This file contains 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,7 @@ | ||
<table class="subcopy" width="100%" cellpadding="0" cellspacing="0" role="presentation"> | ||
<tr> | ||
<td> | ||
{{ Illuminate\Mail\Markdown::parse($slot) }} | ||
</td> | ||
</tr> | ||
</table> |
This file contains 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,3 @@ | ||
<div class="table"> | ||
{{ Illuminate\Mail\Markdown::parse($slot) }} | ||
</div> |
Oops, something went wrong.