Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
What s the best way to send quick one-liner e-mails to an administrative address in Rails?
I am using the Rails Logger
to keep track of nasty problems in my application. One of my controllers is doing mission-critical work and I need to know of any errors ASAP. When there is an error, I would like my app to send an email to myself, calling attention to the log containing more details. I m envisioning something like the following pseudo-code:
begin
...
rescue
logger.error("Found an error! Params hash is " + params.to_s)
email("user@example.com","Critical error in log. Investigate line " + len(logger.error).to_s)
end
The obvious first place I looked at was ActionMailer. However, both the documentation and my literature talk about creating a mailer Model, View & Controller, which seems overly complex for what I want: A very short (one-line) e-mail to an email address where formatting & reply-to address doesn t matter at all. This brings me back to my question: What s the best way to send quick one-liner e-mails to an administrative e-mail address in Rails?