1

ThoughtBotからClearanceGemを正常にインストールしました。クリアランスは、新しいsign_up時に確認メールを送信し、以下を追加することを提案します。

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 に答える