Module: EffectiveMailer
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/mailers/concerns/effective_mailer.rb
Overview
Includes some shared mailer methods for effective_* gem mailers
Instance Method Summary collapse
- #headers_for(resource, opts = {}) ⇒ Object
- #mailer_admin ⇒ Object
- #subject_for(action, subject, resource, opts = {}) ⇒ Object
Instance Method Details
#headers_for(resource, opts = {}) ⇒ Object
25 26 27 |
# File 'app/mailers/concerns/effective_mailer.rb', line 25 def headers_for(resource, opts = {}) resource.respond_to?(:log_changes_datatable) ? opts.merge(log: resource) : opts end |
#mailer_admin ⇒ Object
21 22 23 |
# File 'app/mailers/concerns/effective_mailer.rb', line 21 def mailer_admin mailer_settings.mailer_admin end |
#subject_for(action, subject, resource, opts = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/mailers/concerns/effective_mailer.rb', line 11 def subject_for(action, subject, resource, opts = {}) mailer_subject = mailer_settings.mailer_subject if mailer_subject.respond_to?(:call) subject = self.instance_exec(action, subject, resource, opts, &mailer_subject) end subject end |