Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[ANN] RhizMail 0.1.0
Francis Hwang
3/19/2005 7:55:00 PM
Hi all,
I've just released RhizMail 0.1.0.
http://rhizmail.ruby...
== 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, 'webmaster@mysite.com',
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( 'bill@yahoo.com', '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 'bill@yahoo.com'? If so, it'd be nice not to
annoy him.)
Francis Hwang
http://f...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[ANN] RhizMail 0.1.0
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password