https://github.com/markbates/blabber_mouth
Easy model-like notification system for Ruby. (A framework agnostic port of the mack-notifier package.)
https://github.com/markbates/blabber_mouth
Last synced: 12 months ago
JSON representation
Easy model-like notification system for Ruby. (A framework agnostic port of the mack-notifier package.)
- Host: GitHub
- URL: https://github.com/markbates/blabber_mouth
- Owner: markbates
- License: mit
- Created: 2009-07-14T20:39:30.000Z (almost 17 years ago)
- Default Branch: master
- Last Pushed: 2009-07-14T20:42:06.000Z (almost 17 years ago)
- Last Synced: 2025-02-07T18:51:32.858Z (over 1 year ago)
- Language: Ruby
- Homepage: http://www.metabates.com
- Size: 121 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
This gem provides a simple API for creating emails within a Mack application.
A simple BlabberMouth model would look like this:
class WelcomeEmail
include BlabberMouth
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 HTML body")
mail.attach(BlabberMouth::Attachment.new("/path/to/my/image_file.png"))
mail.attach(BlabberMouth::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.