电子邮件通知不是从神宝石发送的

时间:2011-02-19 15:40:03

标签: ruby-on-rails ruby rubygems delayed-job god

我使用神宝石来监控我的delayed_job进程,到目前为止宝石正在按预期工作,但由于某些原因我不能让他发送电子邮件通知(我使用谷歌应用程序)。 这是我的神文件配置:

God::Contacts::Email.defaults do |d|
  d.from_email = 'system@example.com'
  d.from_name = 'Process monitoring'
  d.delivery_method = :smtp
  d.server_host = 'smtp.gmail.com'
  d.server_port = 587
  d.server_auth = true
  d.server_domain = 'example.com'
  d.server_user = 'system@example.com'
  d.server_password = 'myPassword'
end


God.contact(:email) do |c|
  c.name = 'me'
  c.group = 'developers'
  c.to_email = 'me@example.com'
end     

w.start_if do |start|
  start.condition(:process_running) do |c|
  c.interval = 20.seconds
  c.running = false
  c.notify = {:contacts => ['me'], :priority => 1, :category => 'staging'}
end

有什么想法吗?

1 个答案:

答案 0 :(得分:4)

根据邮件列表上的this post

  1. gem install tlsmail
  2. 在电子邮件中添加Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) 神的配置的一部分
  3. 使用:login intead true进行server_auth设置。