Sha256: c28a477d85310318d827d53172b386e917c52968a195b30436649486f3e3cf5f

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

class InquirySetting < ActiveRecord::Base

  def self.confirmation_body
    RefinerySetting.find_or_set(:inquiry_confirmation_body,
      "Thank you for your inquiry %name%,\n\nThis email is a receipt to confirm we have received your inquiry and we'll be in touch shortly.\n\nThanks."
    )
  end

  def self.confirmation_subject
    RefinerySetting.find_or_set(:inquiry_confirmation_subject,
                                "Thank you for your inquiry")
  end

  def self.confirmation_subject=(value)
    # handles a change in Refinery API
    if RefinerySetting.methods.map(&:to_sym).include?(:set)
      RefinerySetting.set(:inquiry_confirmation_subject, value)
    else
      RefinerySetting[:inquiry_confirmation_subject] = value
    end
  end

  def self.notification_recipients
    RefinerySetting.find_or_set(:inquiry_notification_recipients,
                                (defined?(Role) ? Role[:refinery].users.first.email : '' rescue ''))
  end

  def self.notification_subject
    RefinerySetting.find_or_set(:inquiry_notification_subject,
                                "New inquiry from your website")
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
refinerycms-inquiries-0.9.9.2 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.1 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.8.10 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.8.9 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.8.8 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.8.7 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.8.6 app/models/inquiry_setting.rb