mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 05:54:34 +02:00
Add a test email feature to the admin panel - Closes #307
This commit is contained in:
@ -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']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user