Sha256: 0a93d40190863ca788fd62b85d1ff943331f55a92f560070d3a06d915f90de26

Contents?: true

Size: 796 Bytes

Versions: 1

Compression:

Stored size: 796 Bytes

Contents

require "mailkick/version"
require "mailkick/engine"
require "mailkick/processor"
require "mailkick/mailer"
require "mailkick/model"
require "mailkick/service"
require "mailkick/service/mandrill"
require "mailkick/service/sendgrid"

module Mailkick
  mattr_accessor :services, :user_method, :secret_token
  self.services = []
  self.user_method = proc{|email| User.where(email: email).first rescue nil }

  def self.fetch_opt_outs
    services.each do |service|
      service.fetch_opt_outs
    end
  end

  def self.discover_services
    Service.subclasses.each do |service|
      if service.discoverable?
        services << service.new
      end
    end
  end

end

ActionMailer::Base.send :include, Mailkick::Mailer
ActiveRecord::Base.send(:extend, Mailkick::Model) if defined?(ActiveRecord)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mailkick-0.0.1 lib/mailkick.rb