From 28191fd829d2914af9698729dd57338a426fb677 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sat, 18 Jan 2025 14:26:35 +0800 Subject: [PATCH] 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. --- app/mailers/application_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index c146f0a..e4e3ecc 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,4 +1,4 @@ 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" end