Forum: Ruby on Rails welcome mailer not working properly, mail is going every time a user logs in to site

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B5ce46f0ffc7fd83fc3b156938b21327?d=identicon&s=25 Sailatha K. (sailatha_k)
on 2015-02-18 14:52
(Received via mailing list)
welcome mail is going every time a user logs in to site,i only want it
to
go once when user signed up

app/controllers/user_mailer.rb--

class UserMailer < ActionMailer::Base
  default from: "myemailid@gmail.com"
  def registration_confirmation(user)

UserMailer.registration_confirmation(@user).deliver
  end
end

app/mailers/welcome_mailer.rb--

class WelcomeMailer < ActionMailer::Base
  default from: " Impact Institute (alert)
<no-reply@impactinstitute.org>"

  def welcome_confirmation(email)
    @email = email
    mail(:to => "#{email}", :subject => "Welcome to
www.impactinstitute.org!")
  end
end
This topic is locked and can not be replied to.