create team folder

This commit is contained in:
Peter Papp
2021-08-24 10:58:03 +02:00
parent fdd9c5a591
commit ca1d037975
20 changed files with 317 additions and 23 deletions
@@ -0,0 +1,54 @@
<?php
namespace Domain\Teams\Notifications;
use App\Users\Models\User;
use Illuminate\Bus\Queueable;
use Domain\Folders\Models\Folder;
use Illuminate\Notifications\Notification;
use Domain\Teams\Models\TeamFoldersInvitation;
use Illuminate\Notifications\Messages\MailMessage;
class InvitationIntoTeamFolder extends Notification
{
use Queueable;
public function __construct(
public Folder $teamFolder,
public TeamFoldersInvitation $invitation,
) {
}
/**
* Get the notification's delivery channels.
*/
public function via(): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(): MailMessage
{
$appTitle = get_settings('app_title') ?? 'VueFileManager';
$user = User::find($this->invitation->email);
if ($user) {
return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle")
->greeting('Hello!')
->line('You are invited to collaboration with team folder')
->action('Join into Team Folder', url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle");
}
return (new MailMessage)
->subject("You are invited to collaboration with team folder in $appTitle")
->greeting('Hello!')
->line('You are invited to collaboration with team folder. But at first, you have to create an account to proceed into team folder.')
->action('Join & Create an Account', url('/team-folder-invitation', ['id' => $this->invitation->id]))
->salutation("Regards, $appTitle");
}
}