Project

General

Profile

Actions

Defect #22894

closed

Intercepting Emails

Added by Jean Bertrand over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

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 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.

[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
[]
Actions

Also available in: Atom PDF