W3cubDocs

/Padrino

Module: Padrino::Mailer

Overview

This component uses the mail library to create a powerful but simple mailer within Padrino (and Sinatra). There is full support for using plain or html content-types as well as for file attachments.

Using the mailer in Padrino has two forms. The 'quick' method requires only use of the email method directly in the controller:

# app/controllers/session.rb
post :create do
  email do
    from "[email protected]"
    to "[email protected]"
    subject "Welcome!"
    body render('email/registered')
  end
end

Defined Under Namespace

Modules: Helpers, Mime Classes: Base

Class Method Summary

Class Method Details

.registered(app) ⇒ Object Also known as: included

Registers the Padrino::Mailer helpers with the application.

Examples:

require 'padrino-mailer'
class Demo < Padrino::Application
  register Padrino::Mailer::Helpers
end

Parameters:

  • app (Sinatra::Application) — The application that needs mailers.

© 2010–2019 Padrino
Licensed under the MIT License.
https://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Mailer