The old implementation sets default From address in mailers. It sets the address from SMTP_FROM_ADDRESS, or notifications@localhost. The behavior is occasionally undesired results. In production environment, notifications@localhost is likely to be incorrect. In testing environment, the email address should not be varied by a environment variable. After appling this change, In production environment, it will throw an exception when launching Mastodon. In testing environment, the address will be fixed with notifications@localhost.
		
			
				
	
	
		
			15 lines
		
	
	
		
			259 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			259 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # frozen_string_literal: true
 | |
| 
 | |
| class ApplicationMailer < ActionMailer::Base
 | |
|   layout 'mailer'
 | |
|   helper :instance
 | |
| 
 | |
|   protected
 | |
| 
 | |
|   def locale_for_account(account)
 | |
|     I18n.with_locale(account.user_locale || I18n.default_locale) do
 | |
|       yield
 | |
|     end
 | |
|   end
 | |
| end
 |