Class: WelcomeCycle::Driver

Inherits:
Object
  • Object
show all
Defined in:
lib/welcome_cycle/driver.rb

Class Method Summary collapse

Class Method Details

.runObject



3
4
5
6
7
8
9
# File 'lib/welcome_cycle/driver.rb', line 3

def self.run
  raise 'WelcomeCycle is not configured! See the README config section for help.' if WelcomeCycle.config.nil?
  raise "You must set the 'base_class' option. See README config section." if WelcomeCycle.config.base_class.nil?
  WelcomeCycle.config.before_run.call if WelcomeCycle.config.before_run
  WelcomeCycle::EmailRegister.instance.emails.each { |e| e.send_to_recipients! }
  WelcomeCycle.config.after_run.call if WelcomeCycle.config.after_run
end