Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:14:13+00:00 2026-06-09T17:14:13+00:00

I would like to turn off certain emails in development and on test/staging servers,

  • 0

I would like to turn off certain emails in development and on test/staging servers, but keep sending them in production. What I currently do is set the default “to” address for these administrative mails to blank:

  default :to => Rails.env.production? ? "admin-list@sharethevisit.com" : ""

However, this puts stack traces in my development log when I’m testing the user mails which should be sending.

Is there a more effective way of disabling certain emails based on the current environment? I tried checking in the functions themselves, but is not ideal because I have to change each function, plus it doesn’t actually work… it just fails to set the needed @account variable before rendering the email and creating a different stack trace.

  def user_registered_notify_email(account)
    if Rails.env.production?
      @account = account
      mail(:subject => "New user registered: #{@account.full_name}")
    end
  end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:14:15+00:00Added an answer on June 9, 2026 at 5:14 pm

    I usually use mail interceptors as described here: http://asciicasts.com/episodes/206-action-mailer-in-rails-3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting expected notices and warnings and would like to turn them off
I would like to turn off the Required field validation on a certain property
I would like to turn off the dropdown PhoneHelp if phone is selected in
I would like to turn off i18n calls on some forms or even form
I would like to get USB Mass Storage activity to turn on or off
I would like to 'turn off' the compiler for a section of my code.
I would like to turn off the airplane mode if num>50, I implemented this
Basically I would like to turn off antialias in the following: public BufferedImage createText(String
I would like to turn off some Visual Studio warnings including: Field can be
I would like to turn off road/highway markings on google maps. I looked at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.