Class: Octo::ContactUs

Inherits:
Object
  • Object
show all
Includes:
Cequel::Record
Defined in:
lib/octocore-cassandra/models/contactus.rb

Constant Summary

Constants included from Cequel::Record

Cequel::Record::DUMP_ATTRS

Instance Method Summary collapse

Methods included from Cequel::Record

#marshal_dump, #marshal_load, redis, update_cache_config

Instance Method Details

#send_emailObject

Send Email after model save



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/octocore-cassandra/models/contactus.rb', line 19

def send_email

  # Send thankyou mail
  subject = 'Thanks for contacting us - Octo.ai'
	opts = {
		text: 'Hey we will get in touch with you shortly. Thanks :)',
		name: self.firstname + ' ' + self.lastname
	}
	Octo::Email.send(self.email, subject, opts)

  # Send mail to aron and param
  Octo.get_config(:email_to).each { |x|
    opts1 = {
        text: self.email + ' \n\r ' + self.typeofrequest + '\n\r' +  self.message,
        name: x.fetch('name')
    }
    Octo::Email.send(x.fetch('email'), subject, opts1)
  }


end