Sha256: 0476f17f614e94694ea06e7275f9a0b3ef9e6116bfbf07b630f98a88c2e5ab97

Contents?: true

Size: 606 Bytes

Versions: 26

Compression:

Stored size: 606 Bytes

Contents

require 'mail_form'

module Spotlight
  ##
  # Exhibit feedback form
  class ContactForm < MailForm::Base
    attribute :current_exhibit
    attribute :name, validate: false
    attribute :email, validate: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
    attribute :message
    attribute :current_url

    append :remote_ip, :user_agent

    def headers
      {
        subject: "#{I18n.t(:'blacklight.application_name')} Contact Form",
        to: current_exhibit.contact_emails.first,
        from: %("#{name}" <#{email}>),
        cc: current_exhibit.contact_emails.join(', ')
      }
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
blacklight-spotlight-0.17.1 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.17.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.16.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.15.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.14.2 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.14.1 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.14.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.13.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.12.1 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.12.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.11.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.10.3 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.10.2 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.10.1 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.10.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.9.2 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.9.1 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.9.0 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.8.2 app/models/spotlight/contact_form.rb
blacklight-spotlight-0.8.1 app/models/spotlight/contact_form.rb