mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-01 21:00:58 +00:00
* refactor: stabilize model identities for domain migration * refactor: extract module platform context * refactor: assign models to domain contexts * refactor: extract ai platform context * refactor: extract storage platform context * refactor: extract mail platform context * refactor: extract pdf platform context * refactor: extract operations platform context * refactor: move installation into operations platform * refactor: extract money domain context * refactor: extract taxation domain context * refactor: extract catalog domain context * refactor: extract metadata domain context * refactor: extract reporting domain context * refactor: extract purchases domain context * refactor: extract receivables domain context * refactor: extract accounts domain context * refactor: complete reporting statement boundary * refactor: extract contacts domain context * refactor: extract sales domain context * refactor: remove legacy application layers * fix: migrate legacy bouncer role identities
52 lines
1.5 KiB
PHP
52 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Domains\Accounts\Mail;
|
|
|
|
use App\Domains\Accounts\Models\CompanyInvitation;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class CompanyInvitationMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(
|
|
public readonly CompanyInvitation $invitation,
|
|
) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: __('You\'ve been invited to join :company', [
|
|
'company' => $this->invitation->company->name,
|
|
]),
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
$token = $this->invitation->token;
|
|
$hasAccount = $this->invitation->user_id !== null;
|
|
|
|
$acceptUrl = $hasAccount
|
|
? url("/login?invitation={$token}")
|
|
: url("/register?invitation={$token}");
|
|
|
|
return new Content(
|
|
markdown: 'emails.company-invitation',
|
|
with: [
|
|
'invitation' => $this->invitation,
|
|
'companyName' => $this->invitation->company->name,
|
|
'roleName' => $this->invitation->role->title,
|
|
'inviterName' => $this->invitation->invitedBy->name,
|
|
'acceptUrl' => $acceptUrl,
|
|
'declineUrl' => url("/invitations/{$token}/decline"),
|
|
'hasAccount' => $hasAccount,
|
|
],
|
|
);
|
|
}
|
|
}
|