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 7034063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:08:27+00:00 2026-05-28T01:08:27+00:00

So I am setting up a welcome message when a user signs up the

  • 0

So I am setting up a welcome message when a user signs up the website – previously I had set it up using gmail (http://stackoverflow.com/questions/5793296/rails-actionmailer-w-devise-google-apps-in-development-mode), but it’s going to be using google apps – so if I’m correct another stackoverflow user claimed the set up is similar so that’s not a problem. But since I only want a welcome email, I was thinking can I just use the confirmable set up so they get an email, and then in the config set it so that the user doesn’t have to confirm till after say 1000 years or something large so basically it’s not really a confirmation email? (If there is a better way to do this I’d appreciate such input)

  • 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-05-28T01:08:27+00:00Added an answer on May 28, 2026 at 1:08 am

    you don’t need to twist the Confirmable feature to achieve this, you can do it more elegantly with an ActiveRecord::Observer. Basically when you register/save a user the observer will get notified and from there you can call a mailer. You can see an example below.

    app/mailers/user_mailer.rb

    class UserMailer < ActionMailer::Base
      default from: "something@something.com"
    
      def welcome_mail(email)
        mail(:to => email, :subject => "Welcome to Something").deliver
      end
    end
    

    app/models/user_observer.rb

    class UserObserver < ActiveRecord::Observer
      # We check if it's a new user
      def before_save(user)
        @is_new_record = user.new_record?
        true
      end
    
      def after_save(user)
        # If it's not a new user we don't want to send them another welcome email
        if @is_new_record then
          UserMailer.welcome_mail(user.email)
        end
      end
    end
    

    Finally you need to configure rails to register the observer.

    config/application.rb (just a extract)

    config.active_record.observers = :user_observer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want the following behaviour: http://www.example.com/ Should go to: http://example.com/welcome ( DONE BY setting
Setting up an integration server, I’m in doubt about the best approach regarding using
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
I'm using the jGrowl jQuery status-message plugin to display a sticky message on page
I have a problem setting maxReceivedMessageSize for larger files. I'm getting: The maximum message
I am trying to email people using gmail. I am not certain why this
I am setting up a new website and currently if I go to mydomian/php/someScript.php
Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work
Setting up a Windows based web application on Amazon's cloud has definitely been a
Setting up new git installations. On one Windows laptop, I'm running (under cygwin): git

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.