validate(); $this->rateLimit(3, 30); $settings = instanceSettings(); $mailMessage = new MailMessage; $mailMessage->view( 'emails.help', [ 'description' => $this->description, ] ); $mailMessage->subject("[HELP]: {$this->subject}"); $type = set_transanctional_email_settings($settings); // Sending feedback through Cloud API if ($type === false) { $url = 'https://app.coolify.io/api/feedback'; Http::post($url, [ 'content' => 'User: `'.auth()->user()?->email.'` with subject: `'.$this->subject.'` has the following problem: `'.$this->description.'`', ]); } else { send_user_an_email($mailMessage, auth()->user()?->email, 'hi@coollabs.io'); } $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); } return null; } public function render() { return view('livewire.help')->layout('layouts.app'); } }