anlutro / laravel-4-smart-errors

Smarter error handling for Laravel 4
65 stars 13 forks source link

Multiple email recipients in case of error. #16

Closed hkonnet closed 10 years ago

hkonnet commented 10 years ago

Hello Guys,

I think it would be a wonderful idea if we can send error emails to multiple users right now we can send email to a single user mention in config file but i think "dev-email" should be an array for multiple recipients.

I can do this by the way..

Thanks.

anlutro commented 10 years ago

Wouldn't simply setting dev-email to an array of recipients work?

hkonnet commented 10 years ago

No Anluntro! you have to made some changes in ExceptionMailer Class. then it will work you can set dev-email to a string as well as an array of emails.

anlutro commented 10 years ago

All the ExceptionMailer does is take the dev-email config key and pass it to Illuminate\Mail\Message->to(), which takes an array of recipients, which should make it send to all of them. Then again, the Laravel code could be bugged.

hkonnet commented 10 years ago

Anlutro i tried an array of emails in dev-email but that was not working that's why i ask that..

anlutro commented 10 years ago

The following worked for me. Make sure your packages are up-to-date and that your mailer is set up correctly.

Route::get('/e', function() {
    Config::set('smarterror::dev-email', ['andreas@myworkemail.com', 'anlutro@gmail.com']);
    throw new \Exception('Smarterrors test exception');
});