Tag: devise sendgrid

为什么我的Heroku应用程序没有使用Sendgrid在生产中发送电子邮件?

我的设计电子邮件在开发中运行良好。 但是现在我已经推送到Heroku而且正在使用sendgrid附加组件,它们不会被发送。 我没有收到错误。 它似乎发送得很好,只是它从未实际到达我的收件箱。 这是我的config/environment/production.rb文件: config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = false config.action_mailer.default :charset => “utf-8” config.action_mailer.default_url_options = { :host => ‘http://myapp.herokuapp.com’ } config.action_mailer.smtp_settings = { :user_name => ENV[“SENDGRID_USERNAME”], :password => ENV[“SENDGRID_PASSWORD”], :address => ‘smtp.sendgrid.net’, :domain => ‘myapp.herokuapp.com’, :port => 587, :authentication => :plain, :enable_starttls_auto => true } 我在Heroku上检查了那些配置变量,它们返回了有效的结果。 有任何想法吗? PS我还没有指向Heroku App的域名,我只想先用Heroku设置测试它。

没有收到设计确认邮件

按照教程,我将用户身份validation添加到基本的rails应用程序。 有一个步骤,我必须将以下代码添加到setup_mail.rb文件 if Rails.env.development? ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { address: ‘smtp.sendgrid.net’, port: ‘587’, authentication: :plain, user_name: ENV[‘SENDGRID_USERNAME’], password: ENV[‘SENDGRID_PASSWORD’], domain: ‘heroku.com’, enable_starttls_auto: true } end 我添加了sendgrid插件,并将用户ID和密码也放在application.yml文件中。 但是当我注册时,我没有收到确认邮件。 交叉检查development.rb文件,并确保以下代码存在 …. config.action_mailer.default_url_options = { host: ‘localhost:3000’ } config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true end 遵循教程中的单词。 因此真的很难过! 谷歌把我指向了几个地方,让我更加困惑! 这就是我的迁移db文件目前的样子 class DeviseCreateUsers < ActiveRecord::Migration def change create_table(:users) do […]