Sha256: c14ad79e65bf6d50668262c0fb0a2574e591658fde8bb659b12b8e4489e451cf

Contents?: true

Size: 1.94 KB

Versions: 1

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::MockSmtpFacade"
  
  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

1 entries across 1 versions & 1 rubygems

Version Path
bjornblomqvist-emailer-0.1.11 README.rdoc