Title: before_send hook
Last modified: September 24, 2019

---

# before_send hook

 *  Resolved [andresva700](https://wordpress.org/support/users/andresva700/)
 * (@andresva700)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/before_send-hook/)
 * Hi,
 * Thanks for this great plugin.
 * I am trying to hook into the before_sent to filter events. I tried the following
   but it didn’t work:
 *     ```
       function customize_sentry_options($options)
       {
   
           $options['before_send'] = function ($event) {
               return $event;
           };
           return $options;
       }
   
       add_filter('wp_sentry_options', 'customize_sentry_options');
       ```
   
 * I get the this error: Cannot access protected property Raven_Client::$error_types
 * Thanks
    -  This topic was modified 6 years, 8 months ago by [andresva700](https://wordpress.org/support/users/andresva700/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [stayallive](https://wordpress.org/support/users/stayallive/)
 * (@stayallive)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/before_send-hook/#post-11999329)
 * Hi [@andresva700](https://wordpress.org/support/users/andresva700/),
 * Sorry about the late reaction, but I was trying to get version 3.0 out of the
   door.
 * There the problem is fixed. However slightly changed syntax is needed:
 *     ```
       function customize_sentry_options( \Sentry\Options $options ) {
           $options->setBeforeSendCallback(function (\Sentry\Event $event) {
               return $event;
           });
       }
       add_filter( 'wp_sentry_options', 'customize_sentry_options' );
       ```
   
 * Please let me know if this worked for you!

Viewing 1 replies (of 1 total)

The topic ‘before_send hook’ is closed to new replies.

 * ![](https://ps.w.org/wp-sentry-integration/assets/icon-256x256.jpg?rev=1772463)
 * [Sentry for WordPress](https://wordpress.org/plugins/wp-sentry-integration/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-sentry-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-sentry-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-sentry-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-sentry-integration/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [stayallive](https://wordpress.org/support/users/stayallive/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/before_send-hook/#post-11999329)
 * Status: resolved