Sha256: bd09683d5440b49392204df423394a16ff1981ba2153abd5b054566b36b584f0

Contents?: true

Size: 858 Bytes

Versions: 36

Compression:

Stored size: 858 Bytes

Contents

module Merb
  module MailerMixin
    
    # Sends mail via a MailController (a tutorial can be found in the
    # MailController docs).
    #
    # ==== Parameters
    # klass<Class>:: The mailer class.
    # method<~to_s>:: The method to call on the mailer.
    # mail_params<Hash>::
    #   Mailing parameters, e.g. :to and :cc. See
    #   Merb::MailController#dispatch_and_deliver for details.
    # send_params<Hash>::
    #   Params to send to the mailer. Defaults to the params of the current
    #   controller.
    #
    # ==== Examples
    #   # Send an email via the FooMailer's bar method.
    #   send_mail FooMailer, :bar, :from => "foo@bar.com", :to => "baz@bat.com"
    def send_mail(klass, method, mail_params, send_params = nil)
      klass.new(send_params || params, self).dispatch_and_deliver(method, mail_params)
    end
      
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
merb-mailer-1.1.3 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.1.2 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.1.1 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.1.0 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.1.0.rc1 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.1.0.pre lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.0.15 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.0.14 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.0.13 lib/merb-mailer/mailer_mixin.rb
merb-mailer-1.0.12 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.10 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.12 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.13 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.4 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.5 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.6 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.9 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.11 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.7 lib/merb-mailer/mailer_mixin.rb
merb-mailer-0.9.8 lib/merb-mailer/mailer_mixin.rb