0
我试图发送密码重新链接到用户的电子邮件,当他点击忘记密码,并输入他的电子邮件ID。链接到密码重置没有得到发送的邮件通过rails动态邮件发送
这是操作邮件的方法,我使用
class Notifier < ActionMailer::Base
default from: "myemailid"
def deliver_password_reset_instructions(user)
email = "myemailid"
subject= "Password Reset Instructions"
sent_on = Time.now
body={:edit_password_reset_url=>edit_password_reset_url(user.perishable_token)}
mail(:to=>email,:subject=>subject)
end
end
这里是内部通知视图
A request to reset your password has been made. If you did not make this request,
simply ignore this email. If you did make this request just click the link below:
<%= @edit_password_reset_url %>
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problem please feel free to contact us.
Everything else is getting sent but the link is not sent.
I cant seem to find out the problem so pls if any one knows how to solve this issue,pls help.
我修改了我的代码并删除了body,并将edit_password_reset_url作为实例变量,它似乎现在正在工作。感谢您的回答。 –