Class: MailyHerald::SequenceMailing

Inherits:
Mailing show all
Defined in:
app/models/maily_herald/sequence_mailing.rb

Instance Attribute Summary collapse

Attributes inherited from Dispatch

#absolute_delay, #conditions, #from, #list_id, #mailer_name, #name, #override_subscription, #period, #sequence_id, #state, #subject, #template, #title, #type

Instance Method Summary collapse

Methods inherited from Mailing

#ad_hoc?, #build_mail, #conditions, #conditions=, #conditions_changed?, #conditions_met?, #destination, #general_scheduling?, #generic_mailer?, #has_conditions?, #has_conditions_proc?, #individual_scheduling?, #mailer, #mailer_name, #one_time?, #periodical?, #render_subject, #render_template, #sequence?, #test_conditions

Methods included from Autonaming

included

Methods included from TemplateRenderer

included

Methods inherited from Dispatch

#archive, #archive!, #archived?, #disable, #disable!, #disabled?, #enable, #enable!, #enabled?, #has_start_at_proc?, #in_scope?, #list=, #start_at, #start_at=, #start_at_changed?, #subscription_valid?

Instance Attribute Details

#skip_updating_schedulesObject

Returns the value of attribute skip_updating_schedules



7
8
9
# File 'app/models/maily_herald/sequence_mailing.rb', line 7

def skip_updating_schedules
  @skip_updating_schedules
end

Instance Method Details

#absolute_delay_in_daysObject



26
27
28
# File 'app/models/maily_herald/sequence_mailing.rb', line 26

def absolute_delay_in_days
  "%.2f" % (self.absolute_delay.to_f / 1.day.seconds)
end

#absolute_delay_in_days=(d) ⇒ Object



29
30
31
# File 'app/models/maily_herald/sequence_mailing.rb', line 29

def absolute_delay_in_days= d
  self.absolute_delay = d.to_f.days
end

#locked?Boolean



55
56
57
# File 'app/models/maily_herald/sequence_mailing.rb', line 55

def locked?
  MailyHerald.dispatch_locked?(self.sequence.name)
end

#override_subscription?Boolean



47
48
49
# File 'app/models/maily_herald/sequence_mailing.rb', line 47

def override_subscription?
  self.sequence.override_subscription? || super
end

#processable?(entity) ⇒ Boolean



51
52
53
# File 'app/models/maily_herald/sequence_mailing.rb', line 51

def processable? entity
  self.sequence.enabled? && super
end

#processed_to?(entity) ⇒ Boolean

Checks if mailing has been sent to given entity.



34
35
36
# File 'app/models/maily_herald/sequence_mailing.rb', line 34

def processed_to? entity
  self.sequence.processed_mailings_for(entity).include?(self)
end

#schedulesObject

Returns collection of all delivery schedules (Log collection).



43
44
45
# File 'app/models/maily_herald/sequence_mailing.rb', line 43

def schedules
  self.sequence.schedules
end

#update_schedules_callbackObject



38
39
40
# File 'app/models/maily_herald/sequence_mailing.rb', line 38

def update_schedules_callback
  self.sequence.update_schedules_callback
end