Skip to content

feature request Uber::Configuration #13

Description

@timoschilling

Some lines of code, saying more then 1000 words.

module Cells::Mailer::Config
  include Uber::Configuration
  configuration_name :mailer
  configuration_instance_name :mailer_config
  configuration_options :from, :to, :subject
end

module Cells::Mailer
  include Cells::Mailer::Config
end

class ApplicationMailerCell
  include Cells::Mailer
  mailer do
    from "admin@project.com"
  end
end

class FooMailerCell < ApplicationMailerCell
  mailer do
    subject "Foo"
    # `from` will be inherit from ApplicationMailerCell
  end

  def deliver
    mailer_config # => {from: "admin@project.com", subject: "Foo"}
    mailer_config.from # => "admin@project.com"
  end
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions