mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
namespace Domain\Sharing\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Notifications\Notification;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class SharedSendViaEmail extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
/**
|
|
* Create a new notification instance.
|
|
*
|
|
* @param $token
|
|
*/
|
|
public function __construct($token)
|
|
{
|
|
$this->token = $token;
|
|
$this->user = Auth::user();
|
|
}
|
|
|
|
/**
|
|
* 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(__t('shared_link_email_subject', ['user' => $this->user->settings->name]))
|
|
->greeting(__t('shared_link_email_greeting'))
|
|
->line(__t('shared_link_email_user', ['user' => $this->user->settings->name, 'email' => $this->user->email]))
|
|
->action(__t('shared_link_email_link'), url('/share', ['token' => $this->token]))
|
|
->salutation(__t('shared_link_email_salutation', ['app_name' => get_setting('app_title') ?? 'VueFileManager']));
|
|
}
|
|
|
|
/**
|
|
* Get the array representation of the notification.
|
|
*
|
|
* @param mixed $notifiable
|
|
* @return array
|
|
*/
|
|
public function toArray($notifiable)
|
|
{
|
|
return [
|
|
];
|
|
}
|
|
}
|