1

我已经从 ThoughtBot成功安装了Clearance Gem 。Clearance 在新注册时发送确认电子邮件并建议添加:

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

到您的 /environments/test.rb 和 development.rb。我试过这个,也

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

但似乎无法让轨道发送电子邮件。由于我是 Ruby 和 Rails 的新手,我想知道 ThoughtBot 是否假设我已经完成了一些步骤/配置来发送电子邮件。

我在做什么错/错过了什么?

更新:刚刚添加了notifier.rb

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

end
4

1 回答 1

2

我必须生成用户邮件模型。

script/generate mailer UserMailer
于 2010-04-28T19:09:09.427 回答