Class: MailInterceptor::Interceptor
- Inherits:
-
Object
- Object
- MailInterceptor::Interceptor
- Defined in:
- lib/mail_interceptor.rb
Instance Attribute Summary collapse
-
#deliver_emails_to ⇒ Object
Returns the value of attribute deliver_emails_to.
-
#forward_emails_to ⇒ Object
Returns the value of attribute forward_emails_to.
-
#subject_prefix ⇒ Object
Returns the value of attribute subject_prefix.
Instance Method Summary collapse
- #delivering_email(message) ⇒ Object
-
#initialize(options = {}) ⇒ Interceptor
constructor
A new instance of Interceptor.
Constructor Details
#initialize(options = {}) ⇒ Interceptor
Returns a new instance of Interceptor.
9 10 11 12 13 14 15 16 |
# File 'lib/mail_interceptor.rb', line 9 def initialize = {} @deliver_emails_to = Array.wrap [:deliver_emails_to] @subject_prefix = [:subject_prefix] || '' @forward_emails_to = .fetch :forward_emails_to add_env_info_to_subject_prefix sanitize_forward_emails_to end |
Instance Attribute Details
#deliver_emails_to ⇒ Object
Returns the value of attribute deliver_emails_to.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def deliver_emails_to @deliver_emails_to end |
#forward_emails_to ⇒ Object
Returns the value of attribute forward_emails_to.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def forward_emails_to @forward_emails_to end |
#subject_prefix ⇒ Object
Returns the value of attribute subject_prefix.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def subject_prefix @subject_prefix end |
Instance Method Details
#delivering_email(message) ⇒ Object
18 19 20 21 |
# File 'lib/mail_interceptor.rb', line 18 def delivering_email add_subject_prefix .to = normalize_recipients(.to).flatten.uniq end |