https://github.com/25th-floor/zf2-exception-mailer-module
ZendFramework 2 Exception Mailer Module
https://github.com/25th-floor/zf2-exception-mailer-module
Last synced: 18 days ago
JSON representation
ZendFramework 2 Exception Mailer Module
- Host: GitHub
- URL: https://github.com/25th-floor/zf2-exception-mailer-module
- Owner: 25th-floor
- Created: 2013-05-03T13:44:45.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T07:55:07.000Z (almost 7 years ago)
- Last Synced: 2025-04-03T16:52:32.009Z (2 months ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 1
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ZendFramework 2 Exception Mailer Module
A simple ZF2 Module for sending Mails if Exceptions happen on production systems. In it's simplest configuration it
just sends the stack trace of the Exception. But you can also render views and send html mails instead.## Installation
Installation of this module uses composer. For composer documentation, please refer to
[getcomposer.org](http://getcomposer.org/).```sh
php composer.phar require 25th/zf2-exception-mailer-module
# (When asked for a version, type `0.*`)
```Then add `ExceptionMailer` to your `config/application.config.php`.
Installation without composer is not officially supported and requires you to manually install all dependencies
that are listed in `composer.json`## Configuration
To configure the Mailer use your application config:
```php
array(
'send' => true,
'sender' => '[email protected]',
'recipients' => array(
'[email protected]',
),
'subject' => 'My Exception Mailer',
'exceptionInSubject' => false// HTML Templates
'useTemplate' => false,
'template' => 'error/index'
),
);
```### Ignore Exceptions
It's also possible to ignore certain Exceptions. Just let them implement the IgnoreExceptionInterface and they will be
ignored.### HTML Emails
For HTML Emails set useTemplate to true and use the template parameter for your template configuration.
If you want to use a different template f.e. "error/mail" you also have to define it in the
view_manager => template_map array with the correct position to it```php
array(
'template_map' => array(
...
'error/mail' => __DIR__ . '/../view/error/mail.phtml', // Exception_Mailer
...
),
),
...
);
```