Sha256: 80245adbdfd1c1eef19e08998801696bb7e77bbac7b2cdbb5301e5423816dd08

Contents?: true

Size: 999 Bytes

Versions: 19

Compression:

Stored size: 999 Bytes

Contents

require 'mail_form'

class ContactForm < MailForm::Base
  ISSUE_TYPES = [
      ["Depositing content", "Depositing content"],
      ["Making changes to my content", "Making changes to my content"],
      ["Browsing and searching", "Browsing and searching"],
      ["Reporting a problem", "Reporting a problem"],
      ["General inquiry or request", "General inquiry or request"]
    ]
  attribute :contact_method, captcha: true
  attribute :category, validate: true
  attribute :name, validate: true
  attribute :email, validate: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
  attribute :subject, validate: true
  attribute :message, validate: true
  # - can't use this without ActiveRecord::Base validates_inclusion_of :issue_type, in: ISSUE_TYPES

  # Declare the e-mail headers. It accepts anything the mail method
  # in ActionMailer accepts.
  def headers
    {
      subject: "Contact Form:#{subject}",
      to: Sufia.config.contact_email,
      from: Sufia.config.from_email
    }
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sufia-6.2.0 app/models/contact_form.rb
sufia-6.1.0 app/models/contact_form.rb
sufia-5.0.0 app/models/contact_form.rb
sufia-6.0.0 app/models/contact_form.rb
sufia-6.0.0.rc4 app/models/contact_form.rb
sufia-6.0.0.rc3 app/models/contact_form.rb
sufia-5.0.0.rc1 app/models/contact_form.rb
sufia-6.0.0.rc2 app/models/contact_form.rb
sufia-6.0.0.rc1 app/models/contact_form.rb
sufia-4.3.1 app/models/contact_form.rb
sufia-6.0.0.beta1 app/models/contact_form.rb
sufia-4.2.0 app/models/contact_form.rb
sufia-4.1.0 app/models/contact_form.rb
sufia-4.0.1 app/models/contact_form.rb
sufia-4.0.0 app/models/contact_form.rb
sufia-4.0.0.rc2 app/models/contact_form.rb
sufia-4.0.0.rc1 app/models/contact_form.rb
sufia-4.0.0.beta4 app/models/contact_form.rb
sufia-4.0.0.beta3 app/models/contact_form.rb