After a simple setup this module will allow you to get notifications by email about occured errors in Javasccript. This bundle can be used as an independent module or together with BadaBoom bundle.
Add FOSUserBundle in your composer.json:
{
"require": {
"fp/jserrornotifier-bundle": "dev-master"
}
}
Now tell composer to download the bundle by running the command:
$ php composer.phar update fp/jserrornotifier-bundle
Composer will install the bundle to your vendors
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Fp\JsErrorNotifierBundle\FpJsErrorNotifierBundle(),
);
}
# app/config/security.yml
security:
access_control:
- { path: ^/fp_js_error_notifier, role: IS_AUTHENTICATED_ANONYMOUSLY }
# app/config/routing.yml
fp_js_error_notifier:
resource: "@FpJsErrorNotifierBundle/Resources/config/routing.xml"
{% javascripts '@FpJsErrorNotifierBundle/Resources/public/js/jsErrorNotifier.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
If you have an enabled and configured BadaBoom bundle, you can skip this step. Otherwise you have to add some configurations for this bundle:
# app/config/config.yml
fp_js_error_notifier:
email_from: '[email protected]' # sender email
email_to: ['[email protected]'] # list of recipients notification