Class: Integral::Enquiry

Inherits:
ApplicationRecord show all
Defined in:
app/models/integral/enquiry.rb

Overview

Represents a contact enquiry made by visitors

Instance Method Summary collapse

Methods inherited from ApplicationRecord

available_statuses

Instance Method Details

#processObject

Forward the enquiry on and send an auto reply. Create newsletter signup if necessary



17
18
19
20
21
# File 'app/models/integral/enquiry.rb', line 17

def process
  ContactMailer.forward_enquiry(self).deliver_later
  ContactMailer.auto_reply(self).deliver_later
  NewsletterSignup.create(name: name, email: email, context: context) if newsletter_opt_in?
end

#referenceObject

Reference used to uniquely identify the enquiry



24
25
26
27
# File 'app/models/integral/enquiry.rb', line 24

def reference
  num = 3008 + id
  "##{num}"
end