File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Illuminate \Auth \Events \Registered ;
8
8
use Illuminate \Support \Facades \Schema ;
9
9
use Illuminate \Support \Facades \File ;
10
+ use Illuminate \Support \Facades \Mail ;
10
11
11
12
use GeoSot \EnvEditor \Controllers \EnvController ;
12
13
use GeoSot \EnvEditor \Exceptions \EnvException ;
@@ -92,6 +93,23 @@ public function searchUser(Request $request)
92
93
return view ('panel/users ' , $ data );
93
94
}
94
95
96
+ // Send test mail
97
+ public function SendTestMail (Request $ request )
98
+ {
99
+ try {
100
+ $ userId = auth ()->id ();
101
+ $ user = User::findOrFail ($ userId );
102
+
103
+ Mail::send ('auth.test ' , ['user ' => $ user ], function ($ message ) use ($ user ) {
104
+ $ message ->to ($ user ->email )
105
+ ->subject ('Test Email ' );
106
+ });
107
+
108
+ return redirect ()->route ('showConfig ' )->with ('success ' , 'Test email sent successfully! ' );
109
+ } catch (\Exception $ e ) {
110
+ return redirect ()->route ('showConfig ' )->with ('fail ' , 'Failed to send test email. Please try again later. ' );
111
+ }
112
+ }
95
113
96
114
//Block user
97
115
public function blockUser (request $ request )
Original file line number Diff line number Diff line change
1
+ <x-guest-layout >
2
+ <div class =" mb-4 text-sm text-gray-600" >
3
+ {{ __ (' Test E-Mail' ) } }
4
+ </div >
5
+ <br ><br >
6
+ </x-guest-layout >
Original file line number Diff line number Diff line change @@ -380,6 +380,20 @@ function text($key){
380
380
</div >
381
381
<button type =" submit" class =" mt-3 ml-3 btn btn-info" >Apply changes</button >
382
382
</form >
383
+
384
+ <div class =" form-group col-lg-8" >
385
+ <br ><br ><h5 >Test E-Mail setup:</h5 >
386
+ @if (session (' success' ) )
387
+ <div class =" alert alert-success" >
388
+ {{ session (' success' ) } }
389
+ </div >
390
+ @elseif (session (' fail' ) )
391
+ <div class =" alert alert-danger" >
392
+ {{ session (' fail' ) } }
393
+ </div >
394
+ @endif
395
+ </div >
396
+ <a href =" {{ route (' SendTestMail' )} }" ><button class =" mt-3 ml-3 btn btn-outline-secondary" >Send Test E-Mail</button ></a >
383
397
{{-- end SMTP settings --}}
384
398
385
399
Original file line number Diff line number Diff line change 173
173
Route::get ('/update/theme ' , [AdminController::class, 'updateThemes ' ])->name ('updateThemes ' );
174
174
Route::get ('/panel/config ' , [AdminController::class, 'showConfig ' ])->name ('showConfig ' );
175
175
Route::post ('/panel/config ' , [AdminController::class, 'editConfig ' ])->name ('editConfig ' );
176
+ Route::get ('/send-test-email ' , [AdminController::class, 'SendTestMail ' ])->name ('SendTestMail ' );
176
177
Route::get ('/theme-updater ' , function () {return view ('studio/theme-updater ' , []);});
177
178
Route::get ('/update ' , function () {return view ('update ' , []);});
178
179
Route::get ('/backup ' , function () {return view ('backup ' , []);});
You can’t perform that action at this time.
0 commit comments