Sha256: 2da12bc4ed1e2f87cd5b8feeb324d575a4a17a91caa4ff307404b6198bc53813
Contents?: true
Size: 636 Bytes
Versions: 22
Compression:
Stored size: 636 Bytes
Contents
module Spotlight ## # Exhibit feedback form class ContactForm include ActiveModel::Model attr_accessor :current_exhibit, :name, :email, :message, :current_url, :request validates :email, format: { with: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i } def headers { to: to, subject: "#{I18n.t(:'blacklight.application_name')} Contact Form", from: %("#{name}" <#{email}>), cc: current_exhibit.contact_emails.join(', ') } end private def to Spotlight::Engine.config.default_contact_email || current_exhibit.contact_emails.first.to_s end end end
Version data entries
22 entries across 22 versions & 1 rubygems