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



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

def auto_reply(enquiry)
  @enquiry = enquiry

  I18n.locale = @enquiry.context

  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
# File 'app/mailers/integral/contact_mailer.rb', line 10

def forward_enquiry(enquiry)
  @enquiry = enquiry

  mail subject: forwarding_subject(enquiry), from: email_sender(enquiry.name, outgoing_email_address), to: incoming_email_address, reply_to: email_sender(enquiry.name, enquiry.email)
end