I have a devise model called members
i am using devise confirmable. Upon confirm i want to send a welcome email to the User
class Member < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
# Methods
# Override devise confirm! message
def confirm!
welcome_email
super
end
# Private Methods
private
def welcome_email
MemberMailer.welcome_email(self).deliver
end
end
My MemberMailer resides in mailers/brands/member_mailer.rb
class Brands::MemberMailer < ApplicationMailer
# Send Welcome Email once Member confirms the account
def welcome_email(member)
@member = member
mail(to: @member.email, subject: "Welcome to Skreem! Now you Rock!")
end
end
But upon confirming through the mail Link the confirm!
is not being overridden and I am not getting any error or email.