Add a test email feature to the admin panel - Closes #307

This commit is contained in:
Bubka
2024-02-26 15:06:26 +01:00
parent 04078b09aa
commit 88d37394d3
10 changed files with 191 additions and 5 deletions

View File

@ -3,10 +3,12 @@
namespace App\Http\Controllers;
use App\Facades\Settings;
use App\Notifications\TestEmailSettingNotification;
use App\Services\ReleaseRadarService;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class SystemController extends Controller
{
@ -58,4 +60,20 @@ class SystemController extends Controller
return response()->json(['newRelease' => $release]);
}
/**
* Send a test email.
*
* @return \Illuminate\Http\JsonResponse
*/
public function testEmail(Request $request)
{
try {
$request->user()->notify(new TestEmailSettingNotification());
} catch (\Throwable $th) {
Log::error($th->getMessage());
}
return response()->json(['message' => 'Ok']);
}
}