-
-
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 Test Notification Created Test Notification. Updated Vendor Mail message.blade files. Updated api settings controller to use Notification Façade. * Add show URL in Emails condition * New Welcome Notification
- Loading branch information
1 parent
30c5cc1
commit 688a325
Showing
4 changed files
with
106 additions
and
8 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,66 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
|
||
class WelcomeNotification 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['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'] ])) | ||
->markdown('notifications.Welcome', $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,19 @@ | ||
@component('mail::message') | ||
{{ trans('mail.hello') }} {{ $first_name }}, | ||
|
||
{{ trans('mail.admin_has_created', ['web' => $snipeSettings->site_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 |