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
7 8 9 10 11 12 13 |
# File 'lib/mail_interceptor.rb', line 7 def initialize = {} @deliver_emails_to = Array.wrap [:deliver_emails_to] @subject_prefix = [:subject_prefix] || '' @forward_emails_to = .fetch :forward_emails_to sanitize_forward_emails_to end |
Instance Attribute Details
#deliver_emails_to ⇒ Object
Returns the value of attribute deliver_emails_to.
5 6 7 |
# File 'lib/mail_interceptor.rb', line 5 def deliver_emails_to @deliver_emails_to end |
#forward_emails_to ⇒ Object
Returns the value of attribute forward_emails_to.
5 6 7 |
# File 'lib/mail_interceptor.rb', line 5 def forward_emails_to @forward_emails_to end |
#subject_prefix ⇒ Object
Returns the value of attribute subject_prefix.
5 6 7 |
# File 'lib/mail_interceptor.rb', line 5 def subject_prefix @subject_prefix end |
Instance Method Details
#delivering_email(message) ⇒ Object
15 16 17 18 19 |
# File 'lib/mail_interceptor.rb', line 15 def delivering_email add_env_info_to_subject_prefix add_subject_prefix .to = normalize_recipients(.to).flatten.uniq end |