设置设计& Sendgrid在Heroku [英] Setting Up Devise & Sendgrid on Heroku

查看:150
本文介绍了设置设计& Sendgrid在Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站托管在Heroku上,我安装了Sendgrid Add-On,​​因为它看起来好像不太真实 - 但到目前为止,还没有一个电子邮件功能正常工作。我已经阅读了文档,它清楚地说只是添加 - 添加 - 需要更多的配置才能使Devise工作?

My site is hosted on Heroku and I installed the Sendgrid Add-On as it looked almost too good to be true - but so far none of the email functionality is working. I have read the documentation and it clearly says just add-the add on - is more configuration required to get Devise working?

当我选择发送新密码我得到一个404页面,这使我认为有更多的这一点。喜欢Sendgrid如何知道/在哪里使用预先安装的Devise模板?

When I select 'send me new password' I get a 404 page which makes me think there is more to this. Like how does Sendgrid know/where to use the pre-installed Devise templates?

Thx。

推荐答案

今天早上我刚刚设置了Devise和SendGrid,没有任何问题。我要恢复我采取的步骤。

I just set up Devise and SendGrid this morning and have no problems. I'm going to resume the steps I took.

首先,安装Devise和SendGrid。恭喜你,你已经这样做了,)

First, install Devise and SendGrid. Congratulations, you've already done that ;)

然后,为了生产,把它添加到你的文件中:

Then, for production, add this to your files:

config / initializers / devise.rb

config.mailer_sender = "mail-to-send@from.com"






设置Rails ActionMailer使用SendGrid

config.action_mailer.default_url_options = { :host => 'your.websitedomain.com' }
ActionMailer::Base.smtp_settings = {
  :user_name            => ENV['SENDGRID_USERNAME'],
  :password             => ENV['SENDGRID_PASSWORD'],
  :address              => "smtp.sendgrid.net",
  :port                 => 587,
  :enable_starttls_auto => true,
  :authentication       => :plain,
  :domain               => "yourdomain.com"
}

一切都很好用。注册确认,密码恢复...

And everything's working great with that. Sign up confirmations, password recovery...

此外,您应该使用登录扩展(它是免费的),并使用 heroku logs --tail (实时)检查您的日志。
如果您仍然收到错误,请张贴您的日志。

Also, you should use Logging Expanded (it's Free!) and check your logs with heroku logs --tail (for real time). If you still get errors, post your logs.

祝您有一个愉快的一天!

Have a good day !

这篇关于设置设计& Sendgrid在Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆