Class: DevMailInterceptor
- Inherits:
-
Object
- Object
- DevMailInterceptor
- Defined in:
- lib/myrails/templates/rails/app/mailers/dev_mail_interceptor.rb
Class Method Summary collapse
Class Method Details
.append_address_info(part, dev_text) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/myrails/templates/rails/app/mailers/dev_mail_interceptor.rb', line 17 def self.append_address_info(part, dev_text) case part.content_type when %r{^text/plain} then part.body = part.body.to_s + dev_text when %r{^text/html} then part.body = part.body.to_s + ("<pre>#{dev_text}</pre>").html_safe end part.parts.each { |p| append_address_info(p, dev_text)} end |
.delivering_email(message) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/myrails/templates/rails/app/mailers/dev_mail_interceptor.rb', line 4 def self.delivering_email() dev_text = "\n\n\n------------\n" dev_text += "To address is: #{.to.to_a.join(", ")}\n" dev_text += "CC address is: #{.cc.to_a.join(", ")}\n" dev_text += "BCC address is: #{.bcc.to_a.join(", ")}\n" .subject = "[#{Socket.gethostname}] [#{Rails.env}] #{.subject}" .to = '<%= @email %>' .cc = "" .bcc = "" append_address_info(, dev_text) end |