Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

55
app/Mail/TagAddedMail.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
namespace App\Mail;
use App\Models\Tag;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Mail;
class TagAddedMail extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
public $tagId;
public $locale;
/**
* Create a new message instance.
*
* @param $tagInfo
*/
public function __construct($tagId, $locale = null)
{
$this->tagId = $tagId;
$this->locale = $locale ?? App::getLocale();
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
// Set application locale for this email
app()->setLocale($this->locale);
$tagInfo = collect((new Tag())->translateTagIdsWithContexts($this->tagId, $this->locale, App::getFallbackLocale()));
// Handle empty tag info
$tagInfoData = $tagInfo->first();
$tagName = $tagInfoData['tag'] ?? 'Unknown Tag';
return $this
->from(timebank_config('mail.system_admin.email'), timebank_config('mail.system_admin.name'))
->subject(trans('messages.new_tag_added', [], $this->locale) . ': ' . $tagName)
->view('emails.tags.new')
->with(['tagInfo' => $tagInfoData ]);
}
}