# NoMethodError: undefined method \`password\_reset\_instructions' for UserNotifier:Class

**URL:** <https://www.ruby-forum.com/t/nomethoderror-undefined-method-password-reset-instructions-for-usernotifier-class/170259>\
**Category:** Rails\
**Created:** [June 15, 2009, 4:03am UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-password-reset-instructions-for-usernotifier-class/170259 "2009-06-15T04:03:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Barthelemy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@Nicholas\_Barthelemy](https://www.ruby-forum.com/u/Nicholas_Barthelemy)\
**Post date:** [June 15, 2009, 4:03am UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-password-reset-instructions-for-usernotifier-class/170259/1 "2009-06-15T04:03:06Z")

</div>

Any ideas what would be causing this?

NoMethodError: undefined method `password_reset_instructions' for UserNotifier:Class from /Library/Ruby/Gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/ base.rb:400:in `method\_missing’

\*\*\* app/models/user\_notifier.rb  
class UserNotifier \< ActionMailer::Base

def signup\_notification(user)  
setup user  
subject ‘Your new account’  
body :url =\> account\_url  
end

def password\_reset\_instructions(user)  
setup user  
subject “Password Reset Instructions”  
body :edit\_password\_reset\_url =\> edit\_password\_reset\_url  
(user.perishable\_token, :host =\> user.account.host)  
end

protected

def setup(user)  
from “noreply@#{ENV[‘DEFAULT\_DOMAIN’]}”  
recipients user.email  
sent\_on Time.now  
end

end

\*\*\* config/initializers/action\_mailer\_config.rb  
require ‘smtp\_tls’

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:tls =\> true,  
:address =\> “[smtp.gmail.com](http://smtp.gmail.com)”,  
:port =\> 587,  
:domain =\> “”,  
:authentication =\> :plain,  
:user\_name =\> “”,  
:password =\> “”  
}

\*\*\* lib/smtp\_tls.rb  
require “openssl”  
require “net/smtp”

# 

[http://blog.pomozov.info/posts/how-to-send-actionmailer-mails-to-gmailcom.html](http://blog.pomozov.info/posts/how-to-send-actionmailer-mails-to-gmailcom.html)

Net::SMTP.class\_eval do  
private  
def do\_start(helodomain, user, secret, authtype)  
raise IOError, ‘SMTP session already started’ if @started  
check\_auth\_args user, secret, authtype if user or secret

```
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
@socket = Net::InternetMessageIO.new(sock)
@socket.read_timeout = 60 #@read_timeout

check_response(critical { recv_response() })
do_helo(helodomain)

raise 'openssl library not installed' unless defined?(OpenSSL)
starttls
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ssl.sync_close = true
ssl.connect
@socket = Net::InternetMessageIO.new(ssl)
@socket.read_timeout = 60 #@read_timeout
do_helo(helodomain)

authenticate user, secret, authtype if user
@started = true

```

ensure  
unless @started  
# authentication failed, cancel connection.  
@socket.close if not @started and @socket and not  
@socket.closed?  
@socket = nil  
end  
end

def do\_helo(helodomain)  
begin  
if @esmtp  
ehlo helodomain  
else  
helo helodomain  
end  
rescue Net::ProtocolError  
if @esmtp  
@esmtp = false  
@error\_occured = false  
retry  
end  
raise  
end  
end

def starttls  
getok(‘STARTTLS’)  
end

def quit  
begin  
getok(‘QUIT’)  
rescue EOFError  
rescue OpenSSL::SSL::SSLError  
end  
end  
end

Any Help would be greatly appreciated. I get the same result in  
console.

Thanks  
Nicholas

---

<div class="post-metadata">

**Author:** ![Nicholas\_Barthelemy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@Nicholas\_Barthelemy](https://www.ruby-forum.com/u/Nicholas_Barthelemy)\
**Post date:** [June 15, 2009, 7:52am UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-password-reset-instructions-for-usernotifier-class/170259/2 "2009-06-15T07:52:58Z")

</div>

> NoMethodError: undefined method `password\_reset\_instructions’ for  
> UserNotifier:Class

Hi can you post the code from where you are trying to call  
password\_reset\_instructions def?

Sijo
