notification additions
This commit is contained in:
parent
5171f01852
commit
f54b596128
|
@ -64,7 +64,7 @@ class ChargeCreditsCommand extends Command
|
||||||
try {
|
try {
|
||||||
#suspend server
|
#suspend server
|
||||||
$this->line("<fg=yellow>{$server->name}</> from user: <fg=blue>{$user->name}</> has been <fg=red>suspended!</>");
|
$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
|
#add user to notify list
|
||||||
if (!in_array($user, $this->usersToNotify)) {
|
if (!in_array($user, $this->usersToNotify)) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Notifications;
|
namespace App\Notifications;
|
||||||
|
|
||||||
|
use App\Models\Configuration;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
@ -29,7 +30,7 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
|
||||||
*/
|
*/
|
||||||
public function via($notifiable)
|
public function via($notifiable)
|
||||||
{
|
{
|
||||||
return ['mail'];
|
return ['mail' , 'database'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +44,7 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
|
||||||
return (new MailMessage)
|
return (new MailMessage)
|
||||||
->subject('Your servers have been suspended!')
|
->subject('Your servers have been suspended!')
|
||||||
->greeting('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'))
|
->action('Purchase credits', route('store.index'))
|
||||||
->line('If you have any questions please let us know.');
|
->line('If you have any questions please let us know.');
|
||||||
}
|
}
|
||||||
|
@ -57,7 +58,13 @@ class ServersSuspendedNotification extends Notification implements ShouldQueue
|
||||||
public function toArray($notifiable)
|
public function toArray($notifiable)
|
||||||
{
|
{
|
||||||
return [
|
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>
|
||||||
|
",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,11 +114,6 @@ Route::middleware('auth')->group(function () {
|
||||||
Route::resource('api', ApplicationApiController::class)->parameters([
|
Route::resource('api', ApplicationApiController::class)->parameters([
|
||||||
'api' => 'applicationApi',
|
'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');
|
Route::get('/home', [HomeController::class, 'index'])->name('home');
|
||||||
|
|
Loading…
Reference in a new issue