Class EmailMessage
In: app/models/email_message.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

    # File app/models/email_message.rb, line 13
13:   def self.deliver!
14:     # Send all messages, 100 at a time
15:     undelivered.all(:limit => 100).each do |m|
16:       m.deliver!
17:     end
18:   end

Public Instance methods

[Source]

    # File app/models/email_message.rb, line 25
25:   def deliver!
26:     return false if delivered?
27:     EmailMessageMailer.deliver_email_message(self)
28:     update_attributes(:delivered_at => Time.now)
29:   end

TODO: Take this out when we have an email queue processor

[Source]

    # File app/models/email_message.rb, line 21
21:   def deliver_now
22:     deliver!
23:   end

[Source]

    # File app/models/email_message.rb, line 9
 9:   def delivered?
10:     !!delivered_at
11:   end

[Validate]