module Incline::Extensions::ActionMailerBase

Adds the default_hostname, default_sender, and default_recipient methods to the ApplicationMailer::Base class.

Public Class Methods

included(base) click to toggle source

Sets the default from and to address according to the configuration.

# File lib/incline/extensions/action_mailer_base.rb, line 33
def self.included(base)
  base.extend ClassMethods

  class << self

    private

    if method_defined?(:inherited)
      alias_method :incline_original_inherited, :inherited
    else
      def incline_original_inherited(subclass)
        # Do nothing.
      end
    end

    def inherited(subclass)
      incline_original_inherited subclass

      default(
          {
              from: default_sender,
              to: default_recipient
          }
      )
    end
  end

end

Private Class Methods

incline_original_inherited(subclass) click to toggle source
# File lib/incline/extensions/action_mailer_base.rb, line 43
def incline_original_inherited(subclass)
  # Do nothing.
end
inherited(subclass) click to toggle source
# File lib/incline/extensions/action_mailer_base.rb, line 48
def inherited(subclass)
  incline_original_inherited subclass

  default(
      {
          from: default_sender,
          to: default_recipient
      }
  )
end