Sha256: 05d8a21184b2a5325ffcc7df8ee26edd05b07f33acd1920f33f5151eaf3cde41

Contents?: true

Size: 1.31 KB

Versions: 17

Compression:

Stored size: 1.31 KB

Contents

module Refinery
  module <%= namespacing %>
    class Setting < Refinery::Core::BaseModel

      class << self
        def confirmation_body
          Refinery::Setting.find_or_set(:<%= singular_name %>_confirmation_body,
            "Thank you for your <%= singular_name.humanize.downcase %> %name%,\n\nThis email is a receipt to confirm we have received your <%= singular_name.humanize.downcase %> and we'll be in touch shortly.\n\nThanks."
          )
        end

        def confirmation_subject
          Refinery::Setting.find_or_set(:<%= singular_name %>_confirmation_subject,
                                        "Thank you for your <%= singular_name.humanize.downcase %>")
        end

        def confirmation_subject=(value)
          Refinery::Setting.set(:<%= singular_name %>_confirmation_subject, value)
        end

        def notification_recipients
          Refinery::Setting.find_or_set(:<%= singular_name %>_notification_recipients,
                                        (Role[:refinery].users.first.try(:email) if defined?(Role)).to_s)
        end

        def notification_subject
          Refinery::Setting.find_or_set(:<%= singular_name %>_notification_subject,
                                        "New <%= singular_name.humanize.downcase %> from your website")
        end
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-core-2.1.5 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.1.4 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.1.3 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.1.2 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.1.1 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.1.0 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.10 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.9 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.8 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.7 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.6 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb
refinerycms-core-2.0.5 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb
refinerycms-core-2.0.4 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb
refinerycms-core-2.0.3 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb
refinerycms-core-2.0.2 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb
refinerycms-core-2.0.1 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb
refinerycms-core-2.0.0 lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb