Sha256: c5e3a10973e06a7e4560cef6c335c012b90913df8523161f1ab98cbccba836d5
Contents?: true
Size: 743 Bytes
Versions: 19
Compression:
Stored size: 743 Bytes
Contents
module RocketCMS module Models module ContactMessage extend ActiveSupport::Concern include RocketCMS::Model include RocketCMS.orm_specific('ContactMessage') included do apply_simple_captcha message: RocketCMS.configuration.contacts_captcha_error_message validates_email_format_of :email, unless: 'email.blank?' if RocketCMS.configuration.contacts_message_required validates_presence_of :content end validate do if email.blank? && phone.blank? errors.add(:email, I18n.t('rs.no_contact_info')) end end after_create do ContactMailer.new_message_email(self).deliver end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems