markbates / mack-more

All the extra stuff you could want for the Mack Framework.

This URL has Read+Write access

markbates (author)
Mon Oct 06 11:19:35 -0700 2008
commit  6a58d6a30390690c950c9b7adeaeeef7194f9716
tree    3ee98e1d71fd13e751125c716829acb6ebdacbd5
parent  2b553b896ca7f97b3653f6336b0fcb218084aaa5
mack-more / mack-notifier
name age message
..
file README Mon Sep 22 08:19:55 -0700 2008 Removed deprecated support for delivered_emails... [markbates]
file Rakefile Loading commit data...
directory lib/
directory spec/
mack-notifier/README
This gem provides a simple API for creating emails within a Mack application.

A simple Mack::Notifier model would look like this:

  class WelcomeEmail
    include Mack::Notifier
  end
  
To use this in your application you would do something like the following:
 
  mail = WelcomeEmail.new
  mail.to = "foo@example.com"
  mail.from = "me@example.com"
  mail.subject = "Hello"
  mail.body(:plain, "This is my plain text body")
  mail.body(:html, "This is my <b>HTML</b> body")
  mail.attach(Mack::Notifier::Attachment.new("/path/to/my/image_file.png"))
  mail.attach(Mack::Notifier::Attachment.new("/path/to/my/pdf_file.pdf"))
  mail.deliver
  
This gem currently has an adapter for TMail, but it can support any mailing
framework under the covers with the creation of a simple adapter class.

Currently implemented delivery handlers are: SMTP (default), sendmail, and test.

== Testing

When testing you can get access to delivered emails with the delivered_notifiers
method. After each tests these emails will be flushed our of the test handler.

== Rake tasks
  
  # Generates a notifier model, a test, and text and html template files.
  rake generate:notifier