fix: update SMTP username fetching method

- Change from hardcoded default email to using Rails credentials
- Improves security by avoiding exposure of sensitive information

This change ensures that the application fetches the SMTP username
from encrypted credentials, thereby enhancing security and reducing
risk of accidental exposure in the source code.
This commit is contained in:
songtianlun 2025-01-18 14:26:35 +08:00
parent 30da8604bb
commit 28191fd829

View File

@ -1,4 +1,4 @@
class ApplicationMailer < ActionMailer::Base class ApplicationMailer < ActionMailer::Base
default from: ENV.fetch("RAILS_SMTP_USERNAME", "user@example.com") default from: ENV.fetch("RAILS_SMTP_USERNAME", Rails.application.credentials.smtp.user_name)
layout "mailer" layout "mailer"
end end