2010-04-28 2 views
1

ThoughtBot에서 Clearance Gem을 성공적으로 설치했습니다. Clearance는 새로운 sign_up에 대한 확인 이메일을 보내고 /environments/test.rb 및 development.rb에조치 우편 발송자 확인 이메일 - Ruby on Rails

config.action_mailer.default_url_options = { :host => 'localhost:3000' } 

을 추가 할 것을 제안합니다. 나는 이것을 시도하고 또한

config.action_mailer.default_url_options = { :host => '127.0.0.1', :port => 3000 } 

그러나 레일즈가 이메일을 보내지 못하는 것 같습니다. 내가 Ruby와 Rails를 처음 접했을 때, ThoughtBot이 이미 이메일을 보내기 위해 가정 한 단계/설정이 있는지 궁금합니다.

내가 잘못했거나 누락 되었습니까?

은 UPDATE : 그냥 내가 사용자 메일러 모델을 생성했다

class Notifier < ActionMailer::Base 
def signup_notification(recipient) 
    recipients recipient.email_address_with_name 
     bcc  ["[email protected]"] 
     from  "[email protected]" 
     subject "New account information" 
     body  :account => recipient 
    end 

end 
+0

알리미의 일부 줄을 붙여 넣는 것을 잊었습니까? 함수 선언이 없습니다. –

+0

난 단지 코드를 사용 : http://api.rubyonrails.org/classes/ActionMailer/Base.html – bgadoci

+0

당신은'def signup_notification (recipient)'줄을 잊어 버렸습니다. –

답변

2

notifier.rb했다.

script/generate mailer UserMailer