Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Console/Commands/GrantPluginToBundleOwners.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function handle(): int
->distinct()
->pluck('user_id');

$users = User::whereIn('id', $userIds)->get();
$users = User::whereIn('id', $userIds)->whereNotNull('email_verified_at')->get();

if ($users->isEmpty()) {
$this->warn('No users found who have purchased this bundle.');
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/ResendNewPluginNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function handle(): int
}

$recipients = User::query()
->whereNotNull('email_verified_at')
->where('receives_new_plugin_notifications', true)
->whereNotIn('id', $plugins->pluck('user_id'))
->get();
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/SendLegacyLicenseThankYou.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function handle(): int
foreach ($userLicenses as $userId => $licenses) {
$user = $licenses->first()->user;

if (! $user) {
$this->warn("Skipping license(s) for user ID {$userId} - user not found");
if (! $user || ! $user->email_verified_at) {
$this->warn("Skipping license(s) for user ID {$userId} - user not found or email not verified");
$skipped++;

continue;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SendLicenseExpiryWarnings.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private function sendWarningsForDays(int $days, bool $catchUp = false): int
$licenses = $query->get();

foreach ($licenses as $license) {
if ($license->user) {
if ($license->user && $license->user->email_verified_at) {
$license->user->notify(new LicenseExpiryWarning($license, $days));

// Track that we sent this warning
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/SendMaxToUltraAnnouncement.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function handle(): int
]);

$users = User::query()
->whereNotNull('email_verified_at')
->whereHas('subscriptions', function ($query) use ($maxPriceIds) {
$query->where('stripe_status', 'active')
->where('is_comped', false)
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/SendPluginSubmissionReminders.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function handle(): int
}

$users = User::query()
->whereNotNull('email_verified_at')
->whereHas('plugins', function ($query) {
$query->whereIn('status', [PluginStatus::Draft, PluginStatus::Pending, PluginStatus::Rejected]);
})
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/SendUltraFreeUserPromotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function handle(): int
}

$users = User::query()
->whereNotNull('email_verified_at')
->whereDoesntHave('licenses')
->whereDoesntHave('subscriptions')
->get();
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SendUltraLicenseHolderPromotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function handle(): int
foreach ($userLicenses as $userId => $licenses) {
$user = $licenses->first()->user;

if (! $user) {
if (! $user || ! $user->email_verified_at) {
$skipped++;

continue;
Expand Down
1 change: 1 addition & 0 deletions app/Console/Commands/SendUltraUpgradePromotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function handle(): int
$eligiblePriceIds = array_merge($miniPriceIds, $proPriceIds);

$users = User::query()
->whereNotNull('email_verified_at')
->whereHas('subscriptions', function ($query) use ($eligiblePriceIds) {
$query->where('stripe_status', 'active')
->where('is_comped', false)
Expand Down
1 change: 1 addition & 0 deletions app/Jobs/SendNewPluginNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function __construct(public Plugin $plugin) {}
public function handle(): void
{
$recipients = User::query()
->whereNotNull('email_verified_at')
->where('receives_new_plugin_notifications', true)
->where('id', '!=', $this->plugin->user_id)
->get();
Expand Down
4 changes: 4 additions & 0 deletions app/Listeners/SuppressMailNotificationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public function handle(NotificationSending $event): bool
return true;
}

if (! $event->notifiable->email_verified_at) {
return false;
}

return (bool) $event->notifiable->receives_notification_emails;
}
}
Loading
Loading