diff --git a/app/Livewire/Help.php b/app/Livewire/Help.php
index 5e0876f89b..6576705267 100644
--- a/app/Livewire/Help.php
+++ b/app/Livewire/Help.php
@@ -2,8 +2,10 @@
namespace App\Livewire;
+use App\Models\InstanceSettings;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Illuminate\Notifications\Messages\MailMessage;
+use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Route;
use Livewire\Component;
@@ -28,9 +30,8 @@ public function mount()
public function submit()
{
try {
- $this->rateLimit(3, 60);
+ $this->rateLimit(3, 30);
$this->validate();
- $subscriptionType = auth()->user()?->subscription?->type() ?? 'Free';
$debug = "Route: {$this->path}";
$mail = new MailMessage();
$mail->view(
@@ -40,9 +41,21 @@ public function submit()
'debug' => $debug
]
);
- $mail->subject("[HELP - {$subscriptionType}]: {$this->subject}");
- send_user_an_email($mail, auth()->user()?->email, 'hi@coollabs.io');
- $this->dispatch('success', 'Your message has been sent successfully.
We will get in touch with you as soon as possible.');
+ $mail->subject("[HELP]: {$this->subject}");
+ $settings = InstanceSettings::get();
+ $type = set_transanctional_email_settings($settings);
+ if (!$type) {
+ $url = "https://app.coolify.io/api/feedback";
+ if (isDev()) {
+ $url = "http://localhost:80/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($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);
}
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index a6d8a4ae59..23ee3fa065 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -104,7 +104,7 @@ function handleError(?Throwable $error = null, ?Livewire\Component $livewire = n
ray($error);
if ($error instanceof TooManyRequestsException) {
if (isset($livewire)) {
- return $livewire->dispatch('error', "Too many requests. Please try again in {$error->secondsUntilAvailable} seconds.");
+ return $livewire->dispatch('error', "Too many requests.","Please try again in {$error->secondsUntilAvailable} seconds.");
}
return "Too many requests. Please try again in {$error->secondsUntilAvailable} seconds.";
}
diff --git a/config/coolify.php b/config/coolify.php
index 2e15c86182..69ec231461 100644
--- a/config/coolify.php
+++ b/config/coolify.php
@@ -3,6 +3,7 @@
return [
'docs' => 'https://coolify.io/docs/',
'contact' => 'https://coolify.io/docs/contact',
+ 'feedback_discord_webhook' => env('FEEDBACK_DISCORD_WEBHOOK'),
'self_hosted' => env('SELF_HOSTED', true),
'waitlist' => env('WAITLIST', false),
'license_url' => 'https://licenses.coollabs.io',
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
index 0961fad030..b4b81530c8 100644
--- a/docker-compose.prod.yml
+++ b/docker-compose.prod.yml
@@ -46,6 +46,7 @@ services:
- PUSHER_APP_SECRET
- AUTOUPDATE
- SELF_HOSTED
+ - FEEDBACK_DISCORD_WEBHOOK
- WAITLIST
- SUBSCRIPTION_PROVIDER
- STRIPE_API_KEY
diff --git a/resources/views/components/navbar-subscription.blade.php b/resources/views/components/navbar-subscription.blade.php
index 8638430e51..084e778fb4 100644
--- a/resources/views/components/navbar-subscription.blade.php
+++ b/resources/views/components/navbar-subscription.blade.php
@@ -26,11 +26,10 @@ class="transition rounded w-11 h-11" src="{{ asset('coolify-transparent.png') }}