GithubHelp home page GithubHelp logo

Comments (10)

smartinez87 avatar smartinez87 commented on May 27, 2024

As the README says, you should be able to put this in your production.rb environment file:

Whatever::Application.config.middleware.use ExceptionNotifier,
  :email_prefix => "[Whatever] ",
  :sender_address => %{"notifier" <[email protected]>},
  :exception_recipients => %w{[email protected]}

and it's supposed to grab the sender address from there.
Let me know if that works!

from exception_notification.

smaboshe avatar smaboshe commented on May 27, 2024

Thanks for the reply.

Yes, I am using the instructions in the README, I could have been clearer.

I have regular mail being sent from "hello@domain" and would like to send exceptions from "exceptions@domain". ExceptionNotifier is configured as described. It gets set up in an initialiser so that all environments use it. In development, I am using Ryan Bates' letter_opener to see what the messages look like.

In development, what the README describes is what happens:

  1. Regular mail is sent from hello@domain
  2. Exceptions are sent from exceptions@domain

In production, however, both regular email and exceptions are being sent from hello@domain.

Since I need to authenticate to send emails, what seems to be happening is that even for exceptions, the account being authenticated and used is hello@domain. Is there a way to provide separate authentication details for the :sender_address?

In short, it works but not quite the way I'd prefer it to in production.

from exception_notification.

smartinez87 avatar smartinez87 commented on May 27, 2024

can you try moving that set up to the production.rb env file and let me know if the problem persists?

from exception_notification.

smaboshe avatar smaboshe commented on May 27, 2024

Yes, the problem persists even after moving the configuration to the production.rb environment file.

from exception_notification.

smartinez87 avatar smartinez87 commented on May 27, 2024

I tested on some example apps and it works as expected.
Can you provide a failing test case for this? I am not being able to reproduce your error.

from exception_notification.

smartinez87 avatar smartinez87 commented on May 27, 2024

@smaboshe did you have any luck creating a failing test case for this?

from exception_notification.

mcr avatar mcr commented on May 27, 2024

It would be nice to have a method, "send_sample_notification()" that I could invoke from the rails console to validate my MTA settings are correct...

from exception_notification.

jweslley avatar jweslley commented on May 27, 2024

@mcr , try to use background notifications for this purporse. more info here: https://github.com/smartinez87/exception_notification/tree/v3.0.1#background-notifications

from exception_notification.

smartinez87 avatar smartinez87 commented on May 27, 2024

@mcr did using background notifications fixed your issue?

from exception_notification.

jweslley avatar jweslley commented on May 27, 2024

@smaboshe Now is possible to use custom mailer settings for using Exception notification in v4.0.0. Usage:

Whatever::Application.config.middleware.use ExceptionNotification::Rack,
  :email => {
    :email_prefix         => "[Whatever] ",
    :sender_address       => %{"notifier" <[email protected]>},
    :exception_recipients => %w{[email protected]},
    :delivery_method => :postmark,
    :postmark_settings => {
      :api_key => ENV["POSTMARK_API_KEY"]
    }
  }

For more information, checkout the README file.

from exception_notification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.