Hi guys
I have this method in one of my controllers
def sendpassword(email)
@user = User.first(:email => email)
password = ""
chars = ("a".."z").to_a
raise NotFound unless @user
1.upto(10) { |i| password << chars[rand(chars.size-1)] }
@user.password = password
if @user.save
send_mail(MailMailer, :notify_on_event, {
:from => "Maskeet <[email protected]>",
:subject => "Maskeet password recovery",
:to => email
}, { :user => @user })
else
message[:error] = "There is no maskeet user with this email
address, please try again"
render :passwordrequest
end
display @user
end
# view
%h2 Confirmation - login information sent
%p Your login information was sent to
%p= @email
%p You should receive it shortly, so you can proceed to the
= link_to 'login page', url(:login)
And this it's the code for my Mailer
def notify_on_event
# use params[] passed to this controller to get data
# read more at http://wiki.merbivore.com/pages/mailers
@user = params[:user]
render_mail
end
# view
Dear maskeet user,
For safety reasons, the maskeet website does not store passwords in clear.
When you forget your password, maskeet creates a new one that can be
used in place.
You can now connect to your maskeet profile with:
nickname: <%= @user ?>
password: <%= @user.password ?>
To get connected, go to the login page (http://www.maskeet.com/login)
and enter these codes.
We hope to see you soon on maskeet!
The maskeet email robot
The thing it's that the controller display the view but i can't see
the 'mail sent' part in the logs from the Mailer.
Am i doing something wrong ?
Thanks in advance.
--
Rafael George
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---