Class: Integral::ContactMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/integral/contact_mailer.rb

Overview

Handles sending auto replys to visitors and passing on enquiries

Instance Method Summary collapse

Instance Method Details

#auto_reply(enquiry) ⇒ Object

Send an auto reply to the visitor of the supplied enquiry

Parameters:

  • enquiry (Enquiry)

    enquiry which the visitor has created



20
21
22
23
24
25
# File 'app/mailers/integral/contact_mailer.rb', line 20

def auto_reply(enquiry)
  @enquiry = enquiry
  sender = email_sender(Integral::Settings.website_title, outgoing_email_address)

  mail subject: auto_reply_subject(enquiry), to: enquiry.email, from: sender, reply_to: sender
end

#forward_enquiry(enquiry) ⇒ Object

Send supplied enquiry to contact email

Parameters:

  • enquiry (Enquiry)

    enquiry which the visitor has created



10
11
12
13
14
15
# File 'app/mailers/integral/contact_mailer.rb', line 10

def forward_enquiry(enquiry)
  @enquiry = enquiry
  sender = email_sender(enquiry.name, enquiry.email)

  mail subject: forwarding_subject(enquiry), from: sender, to: incoming_email_address, reply_to: sender
end