wip
This commit is contained in:
@@ -13,7 +13,7 @@ class TransactionalEmailChannel
|
||||
public function send(User $notifiable, Notification $notification): void
|
||||
{
|
||||
$settings = InstanceSettings::get();
|
||||
if ($settings->extra_attributes?->get('smtp_active') !== true) {
|
||||
if ($settings->extra_attributes?->get('smtp_enabled') !== true) {
|
||||
return;
|
||||
}
|
||||
$email = $notifiable->email;
|
||||
|
||||
@@ -44,10 +44,10 @@ class DeployedSuccessfullyNotification extends Notification implements ShouldQue
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
$channels = [];
|
||||
if ($notifiable->extra_attributes?->get('smtp_active') && $notifiable->extra_attributes?->get('notifications_email_deployments')) {
|
||||
if ($notifiable->extra_attributes?->get('smtp_enabled') && $notifiable->extra_attributes?->get('notifications_email_deployments')) {
|
||||
$channels[] = EmailChannel::class;
|
||||
}
|
||||
if ($notifiable->extra_attributes?->get('discord_active') && $notifiable->extra_attributes?->get('notifications_discord_deployments')) {
|
||||
if ($notifiable->extra_attributes?->get('discord_enabled') && $notifiable->extra_attributes?->get('notifications_discord_deployments')) {
|
||||
$channels[] = DiscordChannel::class;
|
||||
}
|
||||
return $channels;
|
||||
|
||||
@@ -44,10 +44,10 @@ class DeployedWithErrorNotification extends Notification implements ShouldQueue
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
$channels = [];
|
||||
if ($notifiable->extra_attributes?->get('smtp_active') && $notifiable->extra_attributes?->get('notifications_email_deployments')) {
|
||||
if ($notifiable->extra_attributes?->get('smtp_enabled') && $notifiable->extra_attributes?->get('notifications_email_deployments')) {
|
||||
$channels[] = EmailChannel::class;
|
||||
}
|
||||
if ($notifiable->extra_attributes?->get('discord_active') && $notifiable->extra_attributes?->get('notifications_discord_deployments')) {
|
||||
if ($notifiable->extra_attributes?->get('discord_enabled') && $notifiable->extra_attributes?->get('notifications_discord_deployments')) {
|
||||
$channels[] = DiscordChannel::class;
|
||||
}
|
||||
return $channels;
|
||||
|
||||
@@ -12,13 +12,18 @@ use Illuminate\Notifications\Notification;
|
||||
class TestNotification extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
public string|null $type = null;
|
||||
public function __construct(string|null $type = null)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
$channels = [];
|
||||
if ($notifiable->extra_attributes?->get('smtp_active') && $notifiable->extra_attributes?->get('notifications_email_test')) {
|
||||
if (($this->type === 'smtp' || is_null($this->type)) && $notifiable->extra_attributes?->get('smtp_enabled') && $notifiable->extra_attributes?->get('notifications_smtp_test')) {
|
||||
$channels[] = EmailChannel::class;
|
||||
}
|
||||
if ($notifiable->extra_attributes?->get('discord_active') && $notifiable->extra_attributes?->get('notifications_discord_test')) {
|
||||
if (($this->type === 'discord' || is_null($this->type)) && $notifiable->extra_attributes?->get('discord_enabled') && $notifiable->extra_attributes?->get('notifications_discord_test')) {
|
||||
$channels[] = DiscordChannel::class;
|
||||
}
|
||||
return $channels;
|
||||
|
||||
Reference in New Issue
Block a user