我想在本地测试我的注册过程(开发模式),如何测试电子邮件的发送和呈现方式等?
我不是指单元测试或集成测试,而是指在开发我的应用程序并进入注册页面等时。我希望它发送电子邮件,但发送到不使用 smtp 的文件。
这可能吗?
我有什么选择?
这是可配置的config/environments/*.rb
files.
# 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') }
详细信息可以在配置部分 http://edgeguides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration of 动作邮件程序基础知识 http://edgeguides.rubyonrails.org/action_mailer_basics.html or on ActionMailer::基础 API http://apidock.com/rails/ActionMailer/Base
轨道 4.2:file
交付方式来源 https://github.com/rails/rails/blob/v4.2.0/actionmailer/lib/action_mailer/delivery_methods.rb#L31 and Mail::FileDelivery 源 https://github.com/mikel/mail/blob/2.5.4/lib/mail/network/delivery_methods/file_delivery.rb
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)