You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
526 B
18 lines
526 B
class Contact < MailForm::Base
|
|
attribute :name, validate: true
|
|
attribute :email, validate: /\A([\w.%+\-]+)@([\w\-]+\.)+(\w{2,})\z/i
|
|
attribute :organization
|
|
attribute :message, validate: true
|
|
attribute :nickname, captcha: true
|
|
|
|
# Declare the e-mail headers. It accepts anything the mail method
|
|
# in ActionMailer accepts.
|
|
def headers
|
|
{
|
|
subject: 'Contact Form Inquiry',
|
|
to: ENV['CONTACT_FORM_DESTINATION'] || 'memoryman51@hotmail.com',
|
|
from: %("#{name}" <#{email}>)
|
|
}
|
|
end
|
|
end
|