-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f43351
commit f9eb48c
Showing
3 changed files
with
65 additions
and
1 deletion.
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
57 changes: 57 additions & 0 deletions
57
app/Notifications/Organizations/WelcomeNotificationInAnotherTenant.php
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,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Notifications\Organizations; | ||
|
||
use Filament\Facades\Filament; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Notifications\Messages\MailMessage; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Support\Facades\URL; | ||
use Illuminate\Support\HtmlString; | ||
use Vite; | ||
|
||
class WelcomeNotificationInAnotherTenant extends Notification | ||
{ | ||
use Queueable; | ||
|
||
public string $route = 'filament.organization.pages.dashboard'; | ||
|
||
/** | ||
* Get the notification's delivery channels. | ||
* | ||
* @return array<int, string> | ||
*/ | ||
public function via(object $notifiable): array | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Get the mail representation of the notification. | ||
*/ | ||
public function toMail(object $notifiable): MailMessage | ||
{ | ||
// TODO: change line msg | ||
return (new MailMessage) | ||
->subject(__('email.organization.welcome.subject')) | ||
->line('![Logo](' . Vite::asset('resources/svg/logo.svg') . ')') | ||
->greeting(__('email.organization.welcome.greeting', ['name' => $notifiable->first_name])) | ||
->line( | ||
__('email.organization.welcome.intro_line_1', [ | ||
'institution_name' => Filament::getTenant()?->institution->name ?? '', | ||
'center_name' => Filament::getTenant()?->name ?? '', | ||
]) | ||
) | ||
->line(__('email.organization.welcome.intro_line_2')) | ||
->line(__('email.organization.welcome.intro_line_3')) | ||
->action( | ||
__('email.organization.welcome.accept_invitation'), | ||
URL::signedRoute($this->route, ['tenant' => Filament::getTenant()]) | ||
) | ||
->line(__('email.organization.welcome.intro_line_4')) | ||
->line(new HtmlString(__('email.organization.welcome.intro_line_5'))) | ||
->salutation(__('email.salutation')); | ||
} | ||
} |