Bla*_*man 22 ruby-on-rails actionmailer
我想在本地测试我的注册过程(开发模式),我如何测试如何发送和呈现电子邮件等?
我不是指单元测试或集成测试,而只是在开发我的应用程序并进入注册页面等时.我希望它发送电子邮件但发送到不使用smtp的文件.
这可能吗?
我有什么选择?
Hak*_*onB 45
这可以在config/environments/*.rb
文件中配置.
# output to tmp/mails directory
config.action_mailer.delivery_method = :file
# ... and to specify output location
# config.action_mailer.file_settings = { :location => Rails.root.join('tmp/mail') }
Run Code Online (Sandbox Code Playgroud)
详细信息可以在发现配置部分的动作梅勒基础上或的ActionMailer :: Base的API
Rails 4.2 :file
传递方法源和Mail :: FileDelivery源
通过在浏览器中自动打开文件(当然在开发环境中),LetterOpener使您更简单地预览刚刚发送的电子邮件.
归档时间: |
|
查看次数: |
12906 次 |
最近记录: |