fix: improve email activation error handling
- Add logging for successful email delivery - Implement error handling for email sending failures - Raise exceptions for further handling This change improves the robustness of the email activation process by logging outcomes and handling potential errors, allowing for better debugging and monitoring of email notifications.
This commit is contained in:
parent
c130ffef90
commit
f1f5e37d7b
@ -64,7 +64,14 @@ class User < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def send_activation_email
|
def send_activation_email
|
||||||
UserMailer.account_activation(self).deliver_now
|
begin
|
||||||
|
result = UserMailer.account_activation(self).deliver_now
|
||||||
|
Rails.logger.info "Email sent successfully: #{result.inspect}"
|
||||||
|
rescue => e
|
||||||
|
Rails.logger.error "Failed to send email: #{e.message}"
|
||||||
|
Rails.logger.error e.backtrace.join("\n")
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_reset_digest
|
def create_reset_digest
|
||||||
|
Loading…
Reference in New Issue
Block a user