profile = $profile; $this->changedFields = $changedFields; } public function handle() { if (!$this->profile->email) { Log::warning('SendAccountsEditedByAdminMail: Profile has no email address', [ 'profile_id' => $this->profile->id, 'profile_type' => get_class($this->profile), ]); return; } Log::info('SendAccountsEditedByAdminMail: Sending email', [ 'profile_id' => $this->profile->id, 'profile_type' => get_class($this->profile), 'profile_email' => $this->profile->email, 'changed_fields' => $this->changedFields, ]); Mail::to($this->profile->email)->send( new AccountsEditedByAdminMail($this->profile, $this->changedFields) ); Log::info('SendAccountsEditedByAdminMail: Email sent successfully'); } }