Sha256: 55d2b85dd4e18d80404334735b68f1852354113cfc01c3627e8becf71ab2d594
Contents?: true
Size: 994 Bytes
Versions: 5
Compression:
Stored size: 994 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"] ].freeze 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: "#{Sufia.config.subject_prefix} #{subject}", to: Sufia.config.contact_email, from: email } end end
Version data entries
5 entries across 5 versions & 1 rubygems