Class: Smailer::Models::QueuedMail

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/smailer/models/queued_mail.rb

Instance Method Summary collapse

Instance Method Details

#add_attachment(filename, path) ⇒ Object



48
49
50
# File 'lib/smailer/models/queued_mail.rb', line 48

def add_attachment(filename, path)
  my_mail_template.attachments.build(:filename => filename, :path => path)
end

#attachmentsObject



44
45
46
# File 'lib/smailer/models/queued_mail.rb', line 44

def attachments
  active_mail_template.attachments
end

#body_htmlObject



31
32
33
# File 'lib/smailer/models/queued_mail.rb', line 31

def body_html
  interpolate active_mail_template.body_html
end

#body_textObject



35
36
37
# File 'lib/smailer/models/queued_mail.rb', line 35

def body_text
  interpolate active_mail_template.body_text
end

#keyObject



39
40
41
42
# File 'lib/smailer/models/queued_mail.rb', line 39

def key
  initialize_message_key
  self[:key]
end

#mail_campaign=(campaign) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/smailer/models/queued_mail.rb', line 60

def mail_campaign=(campaign)
  write_attribute(:mail_campaign_id, campaign.try(:id))

  fill_from_campaign_template

  mail_campaign
end

#mail_campaign_id=(campaign_id) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/smailer/models/queued_mail.rb', line 52

def mail_campaign_id=(campaign_id)
  write_attribute(:mail_campaign_id, campaign_id)

  fill_from_campaign_template

  mail_campaign_id
end