I have a UserObserver class and I want to send an email notification to the user when he will be deleted from the database. So in the deleted() method I have
To avoid any complex, probably unnecessary logic, like temporarily storing the deleted user's email address, you may just have to send the notification immediately in this case.
Or, if you're only using their email address (and not any of the other User model properties) in the UserDeleted notification class, just send the email variable to the Queue, as it will not need to reference the User at that point.
i would probably have columns to indicate the status and duration of the users about to be deleted and have a schedule to check daily and send notification to the user before deleting it.