Class: AlchemyCrm::ContactsMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/mailers/alchemy_crm/contacts_mailer.rb

Instance Method Summary collapse

Instance Method Details

#signout_mail(contact, page) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'app/mailers/alchemy_crm/contacts_mailer.rb', line 15

def signout_mail(contact, page)
  @element = page.elements.where(:name => 'newsletter_signout_mail').first
  @contact = contact
  mail(
    :from => @element.ingredient("mail_from"),
    :to => contact.email,
    :subject => @element.ingredient('subject')
  )
end

#signup_mail(contact, page) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'app/mailers/alchemy_crm/contacts_mailer.rb', line 4

def (contact, page)
  @contact = contact
  @newsletter_ids = @contact.subscriptions.collect(&:newsletter_id)
  @element = page.elements.where(:name => 'newsletter_signup_mail').first
  mail(
    :from => @element.ingredient('mail_from'),
    :to => contact.email,
    :subject => @element.ingredient('subject')
  )
end