Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send email notifications for dev env #111

Open
dimalsv opened this issue Jul 27, 2024 · 0 comments
Open

Unable to send email notifications for dev env #111

dimalsv opened this issue Jul 27, 2024 · 0 comments

Comments

@dimalsv
Copy link

dimalsv commented Jul 27, 2024

I put the following configs to application.rb and development.rb

  config.exception_handlder = {
    dev: true,
    email: '[email protected]',

    exceptions: {
      500 => { notification: true }
    }
  }

also I switched config.consider_all_requests_local to false for dev env.

I run project from docker and I have the following configs for emails

  config.action_mailer.perform_deliveries = true
  if ENV.fetch('IN_DOCKER', 'false') === 'true'
    # Use mailcatcher if app is running without docker
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = { address: 'mailcatcher', port: 1025 }
  else
    # Use letter_opener if app is running without docker
    config.action_mailer.delivery_method = :letter_opener
    config.action_mailer.perform_caching = false
  end

and it works perfectly for any other notification. Also I was setting up exception_notification gem and it also was working well. But I guess exception_handlder is a better choice for me.

When I trigger 500 exception I don't see anything in logs as well, only 500 error and it does not trigger exception_handlder mail notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant