我无法获得邮戳来处理注册并忘记密码电子邮件:
user_mailer.rb
class UserMailer < ActionMailer::Base
include Devise::Mailers::Helpers
default from: "donotreply@barnpix.com"
def confirmation_instructions(record)
devise_mail(record, :confirmation_instructions)
end
def reset_password_instructions(record)
devise_mail(record, :reset_password_instructions)
end
def unlock_instructions(record)
devise_mail(record, :unlock_instructions)
end
# you can then put any of your own methods here
end
应用程序.rb
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_key => ENV['9302106a-63xxxx-xxx-xx-'] }
用户.rb
devise :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable
设计.rb
config.mailer = "UserMailer" # UserMailer is my mailer class
我根本无法让它工作。关于我可能做错了什么或我可能缺少什么以使其正常工作的任何提示?