chore: Disable email notifications for unconfirmed users (#10964)

- disable email notifications if the user hasn't confirmed the email yet, as there is potential chance for the emails to bounce
This commit is contained in:
Sojan Jose
2025-02-24 12:14:40 -08:00
committed by GitHub
parent 429d2e5ef5
commit e97489f534
2 changed files with 74 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ class Notification::EmailNotificationService
def perform
# don't send emails if user read the push notification already
return if notification.read_at.present?
# don't send emails if user is not confirmed
return if notification.user.confirmed_at.nil?
return unless user_subscribed_to_notification?
# TODO : Clean up whatever happening over here