Project

General

Profile

Defect #22894

Updated by Toshi MARUYAMA over 8 years ago

Hi ! 
 I try to follow the Rails documentation to intercept email on dev and staging environement  

  
 http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails 

 But it doesn't complatly works, the mail is send to sandbox@example.com but also to the original recipient. 

 When I use byebug just in the first line of the self.delivering_email method message.to is empty. 

 <pre> 
 [1, 7] in /Users/jbertrand/workspace/redmine_silicon/lib/mail_interceptor.rb 
    1: class MailInterceptor 
    2:     def self.delivering_email(message) 
    3:       byebug 
 => 4:       message.subject = "[for: #{message.to.to_s} from: #{message.from.to_s}] #{message.subject}" 
    5:       message.to        = ['test+redmine@siliconsalad.com'] 
    6:     end 
    7: end 
 (byebug) message.to 
 (byebug) message.to.inspect 
 [] 
 </pre>

Back