Module: Padrino::Mailer::Helpers

### Home Classes Methods

### In Files

- lib/padrino-mailer/helpers.rb

### Namespace

- MODULE Padrino::Mailer::Helpers::ClassMethods

### Methods

- ::included
- #deliver
- #email

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Mailer
- Padrino::Mailer::Base
- Padrino::Mailer::Helpers
- Padrino::Mailer::Helpers::ClassMethods
- Padrino::Mailer::Mime
- Mail
- Mail::Message

No matching classes.

# Padrino::Mailer::Helpers

Helpers for defining and delivering email messages.

### Public Class Methods

included(base) click to toggle source

    # File lib/padrino-mailer/helpers.rb, line 7
    def self.included(base) # @private
      base.extend(ClassMethods)
    end

### Public Instance Methods

deliver(mailer_name, message_name, *attributes) click to toggle source

Delivers a mailer message email with the given attributes.

@param [Symbol] mailer_name

    The name of the mailer.

@param [Symbol] message_name

    The name of the message to deliver.

@param attributes

    The parameters to pass to the mailer.

@example

    deliver(:sample, :birthday, "Joey", 21)
    deliver(:example, :message, "John")

@see ClassMethods#deliver

    # File lib/padrino-mailer/helpers.rb, line 48
    def deliver(mailer_name, message_name, *attributes)
      settings.deliver(mailer_name, message_name, *attributes)
    end

email(mail_attributes={}, &block) click to toggle source

Delivers an email with the given mail attributes.

@param [Hash] mail_attributes

    The attributes for this message (to, from, subject, cc, bcc, body, etc).

@param [Proc] block

    The block mail attributes for this message.

@example

    email do
      to      @user.email
      from    "awesomeness@example.com"
      subject "Welcome to Awesomeness!"
      locals  :a => a, :b => b
      render  'path/to/my/template'
    end

@see ClassMethods#email

    # File lib/padrino-mailer/helpers.rb, line 29
    def email(mail_attributes={}, &block)
      settings.email(mail_attributes, &block)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.