0

Rails アプリで exception_notification gem を使用しており、エラー レポートの電子メールを複数の電子メール ID に送信したいと考えています。どうすればそれができますか?

config.middleware.use ExceptionNotification::Rack,
    email: { email_prefix: "[Ay Error] ",
             sender_address: %{"Ay" <adi@yahoo.com>},
             exception_recipients: %w{adi1@yahoo.com}
    }
end

Mailboxer gem を使用してメールを送信しています。Googleで検索してみましたが、解決策が見つかりません。前もって感謝します

4

3 に答える 3

1

ファイルconfig/initializers/exception_notification.rbを追加します

次のコードを追加します

    require 'exception_notification/rails'

    ExceptionNotification.configure do |config|

      ##Send notifications if rails running in production mode
      config.ignore_if do |exception, options|
        not Rails.env.production?
      end

      ##add notifier
      config.add_notifier :email, {
        :email_prefix         => "Error Prefix ",
        :sender_address       => "Sender address",
        :exception_recipients => ['developer1@example.com', 'developer2@example2.com'],
        :delivery_method => :smtp,
        :smtp_settings => {
          :user_name => "User Name",
          :password => "Password",
          :domain => "domain",
          :address => "Address",
          :port => 587,
          :authentication => :plain,
          :enable_starttls_auto => true
        }
      }

  end
于 2015-03-27T13:18:50.497 に答える
0

ExceptionNotification::Notifier.exception_recipients = %w(test1@test.com test2@test.com) ExceptionNotification::Notifier.sender_address = %("Exception Notifier" ) ExceptionNotification::Notifier.email_prefix = "[エラー: プロジェクト名] "

于 2015-03-01T14:05:10.313 に答える