【问题标题】:sendgrid addon on heroku and deviseheroku 上的 sendgrid 插件和设计
【发布时间】:2013-10-28 10:06:18
【问题描述】:

请帮忙!我似乎无法让 sendgrid 插件工作,我已经设计好了。有没有办法将设备用作电子邮件的发件人,如果是,那么如何?或者我做错了什么: 这是我重要的 config/initializers/devise.rb 代码:

 Devise.setup do |config|
   # ==> Mailer Configuration

   #config.mailer_sender = "myapp.herokuapp.com"

   # Configure the class responsible to send e-mails.
   #config.mailer = "Devise::Mailer"

如果我想使用 sendgrid,是否必须取消注释?

在 environment/production.rb 我有:

 config.action_mailer.default_url_options = { :host => 'myapp.herokuapp.com' }

【问题讨论】:

  • 我也遇到了同样的问题。

标签: ruby-on-rails ruby heroku devise sendgrid


【解决方案1】:

你完成了基本的 Sendgrid 配置了吗?

https://devcenter.heroku.com/articles/sendgrid

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
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-21
    • 2016-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多