Module: ActsAsNewsletter

Defined in:
lib/acts_as_newsletter/model.rb,
lib/acts_as_newsletter.rb,
lib/acts_as_newsletter/mailer.rb,
lib/acts_as_newsletter/railtie.rb,
lib/acts_as_newsletter/version.rb,
lib/acts_as_newsletter/model/config.rb,
lib/generators/acts_as_newsletter/install/install_generator.rb

Overview

Module allowing to simply configure a model to be sent as a newsletter It can be mixed in an ActiveRecord model by calling the ‘acts_as_newsletter` macro directly in your class’ body

Examples:

class Newsletter < ActiveRecord::Base
  acts_as_newsletter do |newsletter|
    emails newsletter.emails
    template_path "emails"
    template_name "newsletter"
    layout false
  end
end

Defined Under Namespace

Modules: Generators, Model Classes: Config, Mailer, Railtie

Constant Summary collapse

VERSION =
"0.1"

Class Method Summary collapse

Class Method Details

.config {|Config.new(&block)| ... } ⇒ Object

Yields:



25
26
27
# File 'lib/acts_as_newsletter.rb', line 25

def self.config &block
  yield Config.new(&block) if block_given?
end