Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class FEN_Groundhogg extends FEN_Integration {
- public $slug = 'groundhogg';
- public $title = 'Groundhogg';
- /**
- * Get registered error types
- *
- * @return array Types
- */
- public function get_error_types() {
- $types = array(
- 'email_api_error' => 'Email sending error',
- 'cron_error' => 'Cron error',
- );
- return $types;
- }
- /**
- * Get things started
- *
- * @return void
- */
- public function init() {
- add_action( 'groundhogg/email_result', array( $this, 'handle_email_result' ), 10, 2 );
- add_action( 'groundhogg/cron_action_happened', array( $this, 'handle_cron_action' ), 10, 2 );
- }
- /**
- * Report error
- *
- * @return void
- */
- public function handle_email_result( $some_stuff, $status ) {
- if ( 'error' !== $status ) {
- return;
- }
- $error = array(
- 'type' => 'email_api_error',
- 'message' => 'Error doing x y z :'
- );
- $this->handle_error( $error );
- }
- /**
- * Report error
- *
- * @return void
- */
- public function handle_cron_action( $some_stuff, $status ) {
- if ( 'error' !== $status ) {
- return;
- }
- $error = array(
- 'type' => 'cron_error',
- 'message' => 'Error doing x y z :'
- );
- $this->handle_error( $error );
- }
- }
- new FEN_Groundhogg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement