Class: Caffeinate::ActionMailer::Observer

Inherits:
Object
  • Object
show all
Defined in:
lib/caffeinate/action_mailer/observer.rb

Overview

Handles updating the Caffeinate::Message if it’s available in Mail::Message.caffeinate_mailing and runs any associated callbacks

Class Method Summary collapse

Class Method Details

.delivered_email(message) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/caffeinate/action_mailer/observer.rb', line 8

def self.delivered_email(message)
  mailing = message.caffeinate_mailing
  return unless mailing

  mailing.update!(sent_at: Caffeinate.config.time_now, skipped_at: nil) if message.perform_deliveries
  mailing.caffeinate_campaign.to_dripper.run_callbacks(:after_send, mailing, message)
  true
end