mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Notifications: Reorgranised classes into domain specific folders
Closes #4500
This commit is contained in:
@ -5,7 +5,6 @@ namespace BookStack\Settings;
|
||||
use BookStack\Activity\ActivityType;
|
||||
use BookStack\Entities\Tools\TrashCan;
|
||||
use BookStack\Http\Controller;
|
||||
use BookStack\Notifications\TestEmail;
|
||||
use BookStack\References\ReferenceStore;
|
||||
use BookStack\Uploads\ImageService;
|
||||
use Illuminate\Http\Request;
|
||||
@ -69,7 +68,7 @@ class MaintenanceController extends Controller
|
||||
$this->logActivity(ActivityType::MAINTENANCE_ACTION_RUN, 'send-test-email');
|
||||
|
||||
try {
|
||||
user()->notifyNow(new TestEmail());
|
||||
user()->notifyNow(new TestEmailNotification());
|
||||
$this->showSuccessNotification(trans('settings.maint_send_test_email_success', ['address' => user()->email]));
|
||||
} catch (\Exception $exception) {
|
||||
$errorMessage = trans('errors.maintenance_test_email_failure') . "\n" . $exception->getMessage();
|
||||
|
18
app/Settings/TestEmailNotification.php
Normal file
18
app/Settings/TestEmailNotification.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace BookStack\Settings;
|
||||
|
||||
use BookStack\App\MailNotification;
|
||||
use BookStack\Users\Models\User;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
class TestEmailNotification extends MailNotification
|
||||
{
|
||||
public function toMail(User $notifiable): MailMessage
|
||||
{
|
||||
return $this->newMailMessage()
|
||||
->subject(trans('settings.maint_send_test_email_mail_subject'))
|
||||
->greeting(trans('settings.maint_send_test_email_mail_greeting'))
|
||||
->line(trans('settings.maint_send_test_email_mail_text'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user