[ANN] RhizMail 0.1.0

F

Francis Hwang

Hi all,

I've just released RhizMail 0.1.0.

http://rhizmail.rubyforge.org/

== WHAT'S RHIZMAIL? ==
RhizMail is a test-friendly library for sending out customized emails.
This is the library we use day-to-day at rhizome.org, where we send out
more than 100 customized emails a day.

To use RhizMail, create an email and deliver it.

def send_site_message( to_address, to_name, body )
msg = RhizMail::Message.new(
'New features at website.com', to_address, '(e-mail address removed)',
body
)
msg.to_name = to_name
msg.deliver
end

If you want to test this message, you can set the MockMailer to take
place of the default Mailer:

def test_send_site_message
mock_mailer = RhizMail::MockMailer.new
RhizMail::set_mailer mock_mailer
send_site_message( '(e-mail address removed)', 'Bill Smith', 'Hi, Bill!' )
assert_equal( 1, mock_mailer.messages_sent )
assert_equal( 'Bill Smith', mock_mailer.messages_sent.first.to_name
)
end

Basically, this means that you can send out as many emails as you want
in any part of your code, without having to worry that running a test
case will actually send out real emails. (Is there somebody who really
has the email address with '(e-mail address removed)'? If so, it'd be nice not to
annoy him.)

Francis Hwang
http://fhwang.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,162
Messages
2,570,893
Members
47,432
Latest member
GTRNorbert

Latest Threads

Top