Sha256: c2e9f3c34470c15f0e98caaa97fa7f0fc121c4498f56bc0e8f71da27690dd6f7

Contents?: true

Size: 1.94 KB

Versions: 3

Compression:

Stored size: 1.94 KB

Contents

= emailer

Emailer is a collection of utility classes for sending emails
using an existing SMTP service. I personally only use it with
AuthSMTP, and it's not been extensively tested. Use at your 
own risk.

Notice that you'll need to install TMail to use emailer. I've
not included it as a dependency as the gem does not currently
install with Ruby 1.9, there are, however, patched versions out 
there.

I apologize in advance for the lack of documentation. There is
little going on in the code, and the interface should be easy
enough for anyone to figure out with a minute to glance at the
code. Here's a taste:

== Basic use

  smtp = Emailer::AuthsmtpFacade.new :username => '[username]', :pasword => '[password]', :domain => 'localhost'
  smtp.open do
    smtp.send_text(
        :from => 'your@email.com',
        :to => 'to@email.com',
        :subject => 'Thanks',
        :body => 'Mail body.'
      )
  end

== Bulk messages

  queue = Emailer::MailQueue.new smtp
  queue.add(
      :from => 'your@email.com',
      :to => 'to@email.com',
      :subject => 'Thanks',
      :body => 'Mail body.'
    ) { |success, mail| puts "Sent mail to #{mail[:to]}..." }
  queue.process

== Testing using webrat

  Add middleware to render emails for webrat

    Emailer::SmtpFacade.default = Emailer::MockSmtpFacade.new
    config.middleware.use "Emailer::TestingMiddleware"
  
  Then you can get the url to the last email sent using
  
    Emailer::SmtpFacade.default.last_email_sent_url

== Note on Patches/Pull Requests
 
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but
  bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2009 Erik Hansson. See LICENSE for details.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bjornblomqvist-emailer-0.1.12 README.rdoc
bjornblomqvist-emailer-0.1.13 README.rdoc
bjornblomqvist-emailer-0.1.15 README.rdoc