1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Controllers/Support/Messages/SendingController.php
Benjamin Beganović b35bff3cde Forward support messages to contact@invoiceninja.com with system-level info (#2993)
* Sending support messages via API

* Sending log files only if self-hosted

* Remove legacy code
2019-10-17 07:12:38 +11:00

27 lines
587 B
PHP

<?php
namespace App\Http\Controllers\Support\Messages;
use App\Http\Controllers\Controller;
use App\Mail\SupportMessageSent;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
class SendingController extends Controller
{
public function __invoke(Request $request)
{
$request->validate([
'message' => ['required'],
]);
Mail::to(config('ninja.contact.ninja_official_contact'))
->send(new SupportMessageSent($request->message));
return response()->json([
'success' => true
]);
}
}