This project is archived and is in readonly mode.

#1217 ✓wontfix
Darragh Curran

ActionMailer::Base.perform_deliveries to accept a proc

Reported by Darragh Curran | October 15th, 2008 @ 02:41 PM | in 2.x

Here's a patch so that ActionMailer::Base.perform_deliveries will accept a proc -

currently it expects a boolean -

I wanted to easily perform deliveries conditionally in my staging environment - only sending mails where recipient is in certain domain. I can achieve this with a quick but brittle monkey patch.

ActionMailer::Base.perform_deliveries = lambda {|mail| mail.header['to'].to_s =~ /$/}

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket