设计电子邮件确认在 Heroku 上不起作用
当我单击设计发送的确认电子邮件中的链接时,它似乎转到了我的应用程序无法识别的路径。
该网址看起来像这样:
http://glowing-flower-855。 heroku.com/users/confirmation?confirmation_token=lIUuOINyxfTW3TBPPI
看起来正确,但似乎转到我的 500.html 文件。
它与我的用户模型中覆盖 Devise 的 confirm!
方法的代码有关:
def confirm!
UserMailer.welcome_message(self).deliver
super
end
根据我的日志,这是错误:
2011-06-10T03:48:11+00:00 app[web.1]: ArgumentError (A sender (Return-Path, Sender or From) required to send a message):
2011-06-10T03:48:11+00:00 app[web.1]: app/models/user.rb:52:in `confirm!'
它指向这一行:UserMailer.welcome_message(self ).deliver
这是我的用户邮件程序类:
class UserMailer < ActionMailer::Base
def welcome_message(user)
@user = user
mail(:to => user.email, :subject => "Welcome to DreamStill")
end
end
When I click on the link in my confirmation email that devise sends, it seems to go to a path that is not recognized by my application.
The url looks something like this:
http://glowing-flower-855.heroku.com/users/confirmation?confirmation_token=lIUuOINyxfTW3TBPPI
which looks correct, but it seems to go to my 500.html file.
It has something to do with this code in my user model that overrides Devise's confirm!
method:
def confirm!
UserMailer.welcome_message(self).deliver
super
end
According to my logs, this is the error:
2011-06-10T03:48:11+00:00 app[web.1]: ArgumentError (A sender (Return-Path, Sender or From) required to send a message):
2011-06-10T03:48:11+00:00 app[web.1]: app/models/user.rb:52:in `confirm!'
which points to this line: UserMailer.welcome_message(self).deliver
Here's my user mailer class:
class UserMailer < ActionMailer::Base
def welcome_message(user)
@user = user
mail(:to => user.email, :subject => "Welcome to DreamStill")
end
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您缺少“from:”值,这是 SMTP 处理所必需的:
You are missing the "from:" value, it's a must for SMTP handling: