Some checks failed
Build MapleDeploy Coolify Image / build (push) Failing after 8s
- Replace logos, colors (red/stone palette), and fonts (Overlock/Inter) - Replace text logos with PNG from marketing API - Update AGPL source links to match repo owner - Update PostgreSQL to 17 for Alpine 3.23 - Add Forgejo Actions CI workflow - Remove upstream GitHub Actions workflows - Remove Coolify Cloud upsells, Hetzner provider, and telemetry - Update auto-update to point to Forgejo registry
56 lines
1.7 KiB
PHP
56 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire;
|
|
|
|
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Livewire\Attributes\Validate;
|
|
use Livewire\Component;
|
|
|
|
class Help extends Component
|
|
{
|
|
use WithRateLimiting;
|
|
|
|
#[Validate(['required', 'min:10', 'max:1000'])]
|
|
public string $description;
|
|
|
|
#[Validate(['required', 'min:3'])]
|
|
public string $subject;
|
|
|
|
public function submit()
|
|
{
|
|
try {
|
|
$this->validate();
|
|
$this->rateLimit(3, 30);
|
|
|
|
$settings = instanceSettings();
|
|
$mail = new MailMessage;
|
|
$mail->view(
|
|
'emails.help',
|
|
[
|
|
'description' => $this->description,
|
|
]
|
|
);
|
|
$mail->subject("[HELP]: {$this->subject}");
|
|
$type = set_transanctional_email_settings($settings);
|
|
|
|
// MapleDeploy branding: feedback sent to MapleDeploy support
|
|
if (blank($type)) {
|
|
// No external API — log locally when SMTP not configured
|
|
\Illuminate\Support\Facades\Log::info('Feedback from '.auth()->user()?->email.': '.$this->subject.' — '.$this->description);
|
|
} else {
|
|
send_user_an_email($mail, auth()->user()?->email, 'support@mapledeploy.ca');
|
|
}
|
|
$this->dispatch('success', 'Feedback sent.', 'We will get in touch with you as soon as possible.');
|
|
$this->reset('description', 'subject');
|
|
} catch (\Throwable $e) {
|
|
return handleError($e, $this);
|
|
}
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.help')->layout('layouts.app');
|
|
}
|
|
}
|