-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New First Admin Notification (#5147)
* New First Admin Notification * Include Last name in Welcome and First admin Notifications
- Loading branch information
1 parent
688a325
commit 68a9855
Showing
6 changed files
with
102 additions
and
4 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
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,67 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
|
||
class FirstAdminNotification extends Notification | ||
{ | ||
use Queueable; | ||
|
||
private $_data = array(); | ||
|
||
/** | ||
* Create a new notification instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(array $content) | ||
{ | ||
$this->_data['email'] = $content['email']; | ||
$this->_data['first_name'] = $content['first_name']; | ||
$this->_data['last_name'] = $content['last_name']; | ||
$this->_data['username'] = $content['username']; | ||
$this->_data['password'] = $content['password']; | ||
$this->_data['url'] = url('/'); | ||
} | ||
|
||
/** | ||
* Get the notification's delivery channels. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
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(trans('mail.welcome', ['name' => $this->_data['first_name'] . ' ' . $this->_data['last_name'] ])) | ||
->markdown('notifications.FirstAdmin', $this->_data); | ||
} | ||
|
||
/** | ||
* 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,17 @@ | ||
@component('mail::message') | ||
{{ trans('mail.hello') }} {{ $first_name }} {{$last_name}}, | ||
|
||
{{ trans('mail.login') }} {{ $username }} <br> | ||
{{ trans('mail.password') }} {{ $password }} | ||
|
||
@component('mail::button', ['url' => $url]) | ||
Go To {{$snipeSettings->site_name}} | ||
@endcomponent | ||
|
||
{{ trans('mail.best_regards') }} <br> | ||
@if ($snipeSettings->show_url_in_emails=='1') | ||
<p><a href="{{ url('/') }}">{{ $snipeSettings->site_name }}</a></p> | ||
@else | ||
<p>{{ $snipeSettings->site_name }}</p> | ||
@endif | ||
@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