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

Sinatra Example Not Working #495

Open
westonganger opened this issue Jul 24, 2020 · 1 comment
Open

Sinatra Example Not Working #495

westonganger opened this issue Jul 24, 2020 · 1 comment

Comments

@westonganger
Copy link

westonganger commented Jul 24, 2020

The current Sinatra example is not working. The :smtp_settings are not being applied.

Current Non-Working Documentation:

require "exception_notification"

use ExceptionNotification::Rack,
  email: {
    email_prefix: '[Example] ',
    sender_address: %("notifier" <[email protected]>),
    exception_recipients: %w[[email protected]],
    smtp_settings: {
      address: 'localhost',
      port: 1025
    }
  }

Working Version

require "action_mailer"
require "exception_notification"

ActionMailer::Base.smtp_settings = {
  address: 'localhost',
  port: 1025,
}

use ExceptionNotification::Rack,
  email: {
    email_prefix: '[Example] ',
    sender_address: %("notifier" <[email protected]>),
    exception_recipients: %w[[email protected]],
  }

I would be happy to create a PR, I assume that it is this line here which is not behaving correctly:

mail.delivery_method.settings.merge!(@options[:mailer_settings]) if @options[:mailer_settings]

@westonganger
Copy link
Author

westonganger commented Jul 24, 2020

In Rails I always have to set the following line:

# config/environments/development.rb  

config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }

So its possible that this is an issue in Rails too.

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