Email notifications not sent from God's gem

I use the gem of God to follow the delayed_job processes, the gem is still doing its job properly, but for some reason I cannot get it to send email notifications (I use Google apps). Here is my god file configuration:

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

Any thoughts?

+3
source share
1 answer

According to this post on the mailing list:

  • gem install tlsmail
  • Add Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)part of the configuration of the god in the email.
  • Use :loginto enter trueto configure server_auth.
+4
source

Source: https://habr.com/ru/post/1793254/


All Articles