mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-16 03:41:41 +00:00
15 lines
No EOL
538 B
Ruby
15 lines
No EOL
538 B
Ruby
# Contacts are used only for the contact form on the Huginn website. If you host a public Huginn instance, you can use
|
|
# these to receive messages from visitors.
|
|
|
|
class Contact < ActiveRecord::Base
|
|
attr_accessible :email, :message, :name
|
|
|
|
validates_format_of :email, :with => /\A[A-Z0-9._%+-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\Z/i
|
|
validates_presence_of :name, :message
|
|
|
|
after_create :send_contact
|
|
|
|
def send_contact
|
|
ContactMailer.send_contact(self).deliver
|
|
end
|
|
end |