Class: Integral::Enquiry
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Integral::Enquiry
- Defined in:
- app/models/integral/enquiry.rb
Overview
Represents a contact enquiry made by visitors
Instance Attribute Summary collapse
-
#first_name ⇒ Object
NOTE: first_name acts as honey pot.
Instance Method Summary collapse
-
#process ⇒ Object
Forward the enquiry on and send an auto reply.
-
#reference ⇒ Object
Reference used to uniquely identify the enquiry.
Methods inherited from ApplicationRecord
Instance Attribute Details
#first_name ⇒ Object
NOTE: first_name acts as honey pot
6 7 8 |
# File 'app/models/integral/enquiry.rb', line 6 def first_name @first_name end |
Instance Method Details
#process ⇒ Object
Forward the enquiry on and send an auto reply. Create newsletter signup if necessary
19 20 21 22 23 |
# File 'app/models/integral/enquiry.rb', line 19 def process ContactMailer.forward_enquiry(self).deliver_later ContactMailer.auto_reply(self).deliver_later NewsletterSignup.create(name: name, email: email, context: context) if end |
#reference ⇒ Object
Reference used to uniquely identify the enquiry
26 27 28 29 |
# File 'app/models/integral/enquiry.rb', line 26 def reference num = 3008 + id "##{num}" end |