forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
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
b097842
commit a97d22b
Showing
36 changed files
with
364 additions
and
202 deletions.
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
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,21 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Team; | ||
|
||
use App\Models\TeamInvitation; | ||
use Livewire\Component; | ||
|
||
class Invitations extends Component | ||
{ | ||
public $invitations; | ||
protected $listeners = ['refreshInvitations']; | ||
public function refreshInvitations() | ||
{ | ||
$this->invitations = TeamInvitation::whereTeamId(auth()->user()->currentTeam()->id)->get(); | ||
} | ||
public function deleteInvitation(int $invitation_id) | ||
{ | ||
TeamInvitation::find($invitation_id)->delete(); | ||
$this->refreshInvitations(); | ||
} | ||
} |
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
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
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
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,51 @@ | ||
<?php | ||
|
||
namespace App\Notifications\Channels; | ||
|
||
use App\Models\InstanceSettings; | ||
use App\Models\User; | ||
use Illuminate\Mail\Message; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Support\Facades\Mail; | ||
|
||
class TransactionalEmailChannel | ||
{ | ||
public function send(User $notifiable, Notification $notification): void | ||
{ | ||
$email = $notifiable->email; | ||
if (!$email) { | ||
return; | ||
} | ||
$settings = InstanceSettings::get(); | ||
$this->bootConfigs($settings); | ||
$mailMessage = $notification->toMail($notifiable); | ||
|
||
Mail::send( | ||
[], | ||
[], | ||
fn (Message $message) => $message | ||
->from( | ||
$settings->extra_attributes?->get('smtp_from_address'), | ||
$settings->extra_attributes?->get('smtp_from_name') | ||
) | ||
->to($email) | ||
->subject($mailMessage->subject) | ||
->html((string)$mailMessage->render()) | ||
); | ||
} | ||
|
||
private function bootConfigs(InstanceSettings $settings): void | ||
{ | ||
config()->set('mail.default', 'smtp'); | ||
config()->set('mail.mailers.smtp', [ | ||
"transport" => "smtp", | ||
"host" => $settings->extra_attributes?->get('smtp_host'), | ||
"port" => $settings->extra_attributes?->get('smtp_port'), | ||
"encryption" => $settings->extra_attributes?->get('smtp_encryption'), | ||
"username" => $settings->extra_attributes?->get('smtp_username'), | ||
"password" => $settings->extra_attributes?->get('smtp_password'), | ||
"timeout" => $settings->extra_attributes?->get('smtp_timeout'), | ||
"local_domain" => null, | ||
]); | ||
} | ||
} |
Oops, something went wrong.