Class: BarkestCore::ContactMessage
- Inherits:
-
Object
- Object
- BarkestCore::ContactMessage
- Includes:
- ActiveModel::Model, ActiveModel::Validations, EmailTester
- Defined in:
- app/models/barkest_core/contact_message.rb
Overview
Defines the message generated by the generic contact form.
Constant Summary
Constants included from EmailTester
EmailTester::VALID_EMAIL_REGEX
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#related_to ⇒ Object
Returns the value of attribute related_to.
-
#remote_ip ⇒ Object
Returns the value of attribute remote_ip.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#your_email ⇒ Object
Returns the value of attribute your_email.
-
#your_name ⇒ Object
Returns the value of attribute your_name.
Instance Method Summary collapse
-
#full_subject ⇒ Object
Gets the full subject for the message.
-
#send_message ⇒ Object
Sends the message.
Methods included from EmailTester
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def body @body end |
#related_to ⇒ Object
Returns the value of attribute related_to.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def @related_to end |
#remote_ip ⇒ Object
Returns the value of attribute remote_ip.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def remote_ip @remote_ip end |
#subject ⇒ Object
Returns the value of attribute subject.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def subject @subject end |
#your_email ⇒ Object
Returns the value of attribute your_email.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def your_email @your_email end |
#your_name ⇒ Object
Returns the value of attribute your_name.
9 10 11 |
# File 'app/models/barkest_core/contact_message.rb', line 9 def your_name @your_name end |
Instance Method Details
#full_subject ⇒ Object
Gets the full subject for the message.
19 20 21 22 |
# File 'app/models/barkest_core/contact_message.rb', line 19 def full_subject return if subject.blank? "#{}: #{subject}" end |
#send_message ⇒ Object
Sends the message.
26 27 28 |
# File 'app/models/barkest_core/contact_message.rb', line 26 def BarkestCore::ContactForm.contact(self).deliver_now end |