notification additions

This commit is contained in:
AVMG20 2021-06-26 16:57:03 +02:00
parent 5171f01852
commit f54b596128
3 changed files with 11 additions and 9 deletions

View file

@ -64,7 +64,7 @@ class ChargeCreditsCommand extends Command
try {
#suspend server
$this->line("<fg=yellow>{$server->name}</> from user: <fg=blue>{$user->name}</> has been <fg=red>suspended!</>");
#$server->suspend();
$server->suspend();
#add user to notify list
if (!in_array($user, $this->usersToNotify)) {

View file

@ -2,6 +2,7 @@
namespace App\Notifications;
use App\Models\Configuration;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
@ -29,7 +30,7 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
*/
public function via($notifiable)
{
return ['mail'];
return ['mail' , 'database'];
}
/**
@ -43,7 +44,7 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
return (new MailMessage)
->subject('Your servers have been suspended!')
->greeting('Your servers have been suspended!')
->line("To unsuspend your server/s you need to purchase more credits.")
->line("To automatically re-enable your server/s, you need to purchase more credits.")
->action('Purchase credits', route('store.index'))
->line('If you have any questions please let us know.');
}
@ -57,7 +58,13 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
public function toArray($notifiable)
{
return [
//
'title' => "Servers suspended!",
'content' => "
<h5>Your servers have been suspended!</h5>
<p>To automatically re-enable your server/s, you need to purchase more credits.</p>
<p>If you have any questions please let us know.</p>
<p>Regards,<br />" . config('app.name', 'Laravel') . "</p>
",
];
}
}

View file

@ -114,11 +114,6 @@ Route::middleware('auth')->group(function () {
Route::resource('api', ApplicationApiController::class)->parameters([
'api' => 'applicationApi',
]);
#Testing route to preview new ConfirmedPaymentNotification email
Route::get('test' , function(Request $request){
return (new \App\Notifications\ConfirmPaymentNotification(\App\Models\Payment::factory()->create()))->toMail($request->user());
});
});
Route::get('/home', [HomeController::class, 'index'])->name('home');