Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -12,13 +12,18 @@ use Livewire\Component;
|
||||
class Help extends Component
|
||||
{
|
||||
use WithRateLimiting;
|
||||
|
||||
public string $description;
|
||||
|
||||
public string $subject;
|
||||
|
||||
public ?string $path = null;
|
||||
|
||||
protected $rules = [
|
||||
'description' => 'required|min:10',
|
||||
'subject' => 'required|min:3'
|
||||
'subject' => 'required|min:3',
|
||||
];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->path = Route::current()?->uri() ?? null;
|
||||
@@ -27,6 +32,7 @@ class Help extends Component
|
||||
$this->subject = "Help with {$this->path}";
|
||||
}
|
||||
}
|
||||
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
@@ -38,28 +44,29 @@ class Help extends Component
|
||||
'emails.help',
|
||||
[
|
||||
'description' => $this->description,
|
||||
'debug' => $debug
|
||||
'debug' => $debug,
|
||||
]
|
||||
);
|
||||
$mail->subject("[HELP]: {$this->subject}");
|
||||
$settings = InstanceSettings::get();
|
||||
$type = set_transanctional_email_settings($settings);
|
||||
if (!$type) {
|
||||
$url = "https://app.coolify.io/api/feedback";
|
||||
if (! $type) {
|
||||
$url = 'https://app.coolify.io/api/feedback';
|
||||
if (isDev()) {
|
||||
$url = "http://localhost:80/api/feedback";
|
||||
$url = 'http://localhost:80/api/feedback';
|
||||
}
|
||||
Http::post($url, [
|
||||
'content' => "User: `" . auth()->user()?->email . "` with subject: `" . $this->subject . "` has the following problem: `" . $this->description . "`"
|
||||
'content' => 'User: `'.auth()->user()?->email.'` with subject: `'.$this->subject.'` has the following problem: `'.$this->description.'`',
|
||||
]);
|
||||
} else {
|
||||
send_user_an_email($mail, auth()->user()?->email, 'hi@coollabs.io');
|
||||
send_user_an_email($mail, auth()->user()?->email, 'hi@coollabs.io');
|
||||
}
|
||||
$this->dispatch('success', 'Feedback sent.', 'We will get in touch with you as soon as possible.');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.help')->layout('layouts.app');
|
||||
|
||||
Reference in New Issue
Block a user