Class: SimpleContact::ContactMailer

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

Instance Method Summary collapse

Instance Method Details

#contact_message(message) ⇒ Object

The to, cc, and bcc addresses can be customized in your own application by creating the appropriate environment variables ENV, ENV, ENV respectively An optional subject prefix can be customized in your own application by creating the environment variable ENV. e.g. if ENV = ‘[Our Cool Site]’ the subject would be rendered as “[Our Cool Site] of the message”



5
6
7
8
9
10
11
12
13
14
# File 'app/mailers/simple_contact/contact_mailer.rb', line 5

def contact_message(message)
  @message = message
  mail(
      to: ENV['SIMPLE_CONTACT_TO_EMAIL'], 
      cc: ENV['SIMPLE_CONTACT_CC_EMAIL'], 
      bcc: ENV['SIMPLE_CONTACT_BCC_EMAIL'], 
      from: @message.email, 
      subject: [ENV['SIMPLE_CONTACT_SUBJECT_PREFIX'], @message.subject].join(' ') 
    )
end