Sha256: a34dc0b3ee8574ca90c90b502d31e2f32aeb26194c95a98cf0801423c484b986

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 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,
                                ((Role[:refinery].users.first.email rescue nil) if defined?(Role)).to_s)
  end

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

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
cms-inquiries-1.0.3 app/models/inquiry_setting.rb
cms-inquiries-1.0.2 app/models/inquiry_setting.rb
refinerycms-inquiries-1.0.1 app/models/inquiry_setting.rb
refinerycms-inquiries-1.0.0 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.9 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.8 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.7 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.6 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.5 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.4 app/models/inquiry_setting.rb
refinerycms-inquiries-0.9.9.3 app/models/inquiry_setting.rb