Perform_deliveries = false

Hi,

Can someone explain the proper use of the use of perform_deliveries
in the environment.rb file??

ActionMailer::Base.perform_deliveries = false

I just moved a new controller to the production version of an app,
but wanted to be sure everything was properly configured before
sending out a big mailing, so I set perform_deliveries = false,
believing that would prevent mail from being sent. Big surprise when
my entire mailing list got a copy of the email I was testing. Is
there something ELSE I need to do to keep mail from being sent?

Thanks,
Denise

Try

ActionMailer::Base.delivery_method = :test

From the RoR manual:

However it is worth describing what each statement does

ActionMailer::Base.delivery_method = :test

sets the delivery method to test mode so that email will not actually be
delivered (useful to avoid spamming your users while testing) but
instead it
will be appended to an array (ActionMailer::Base.deliveries).

ActionMailer::Base.perform_deliveries = true

Ensures the mail will be sent using the method specified by
ActionMailer::Base.delivery_method, and finally

ActionMailer::Base.deliveries = []

sets the array of sent messages to an empty array so we can be sure that
anything we find there was sent as part of our current test.

From: [email protected]
[mailto:[email protected]] On Behalf Of Denise
Eatherly
Sent: Tuesday, June 27, 2006 5:41 PM
To: [email protected]
Subject: [Rails] perform_deliveries = false

Hi,

Can someone explain the proper use of the use of perform_deliveries in
the
environment.rb file??

ActionMailer::Base.perform_deliveries = false

I just moved a new controller to the production version of an app, but
wanted to be sure everything was properly configured before sending out
a
big mailing, so I set perform_deliveries = false, believing that would
prevent mail from being sent. Big surprise when my entire mailing list
got
a copy of the email I was testing. Is there something ELSE I need to do
to
keep mail from being sent?

Thanks,

Denise

Hi,

That helped a lot. Thanks.

But when you say “From the RoR manual” what are you using? I use
http://api.rubyonrails.com/
but I didn’t find nearly as clear an explanation there.

Thanks again,
Denise

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs