* Add test call to test notification #675 * Fix queue driver with emails not sending; formatting #675
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Acars;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Pirep;
|
||||
use App\Models\User;
|
||||
use App\Notifications\Messages\UserRegistered;
|
||||
use App\Repositories\AcarsRepository;
|
||||
use App\Services\AirportService;
|
||||
use App\Services\AwardService;
|
||||
@@ -60,6 +61,7 @@ class DevCommands extends Command
|
||||
'metar' => 'getMetar',
|
||||
'recalculate-stats' => 'recalculateStats',
|
||||
'reset-install' => 'resetInstall',
|
||||
'new-user-email' => 'newUserEmail',
|
||||
'xml-to-yaml' => 'xmlToYaml',
|
||||
];
|
||||
|
||||
@@ -290,6 +292,16 @@ class DevCommands extends Command
|
||||
$this->info('Done!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test sending a user a registered email
|
||||
*/
|
||||
protected function newUserEmail()
|
||||
{
|
||||
$user_id = $this->argument('param');
|
||||
$user = User::find($user_id);
|
||||
$user->notify(new UserRegistered($user));
|
||||
}
|
||||
|
||||
public function liveFlights(): void
|
||||
{
|
||||
$acarsRepo = app(AcarsRepository::class);
|
||||
|
||||
@@ -20,7 +20,7 @@ class BaseNotification extends Notification implements ShouldQueue
|
||||
$klass = get_class($this);
|
||||
$notif_config = config('notifications.channels', []);
|
||||
if (!array_key_exists($klass, $notif_config)) {
|
||||
Log::error('Notification type '.$klass.' missing from notifications config');
|
||||
Log::error('Notification type '.$klass.' missing from notifications config, defaulting to mail');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ use Illuminate\Notifications\Messages\MailMessage;
|
||||
|
||||
trait MailChannel
|
||||
{
|
||||
private $mailSubject;
|
||||
private $mailTemplate;
|
||||
private $mailTemplateArgs;
|
||||
protected $mailSubject;
|
||||
protected $mailTemplate;
|
||||
protected $mailTemplateArgs;
|
||||
|
||||
/**
|
||||
* Set the arguments for the toMail() method
|
||||
|
||||
@@ -10,6 +10,8 @@ class AdminUserRegistered extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ class NewsAdded extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $news;
|
||||
|
||||
public function __construct(News $news)
|
||||
|
||||
@@ -13,6 +13,8 @@ class PirepAccepted extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $pirep;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ class PirepRejected extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $pirep;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ class PirepSubmitted extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $pirep;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ class UserPending extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
@@ -17,6 +19,8 @@ class UserPending extends BaseNotification
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->user = $user;
|
||||
|
||||
$this->setMailable(
|
||||
|
||||
@@ -10,6 +10,8 @@ class UserRegistered extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ class UserRejected extends BaseNotification
|
||||
{
|
||||
use MailChannel;
|
||||
|
||||
public $channels = ['mail'];
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user