how to load a file from a plugin when a url is passed

I ended up answering my own question by using the following code

add_filter( 'template_include','include_filter_template_function', 1 );

function include_filter_template_function($template_path ) {
        $template_path = plugin_dir_path( __FILE__ ) .'filter.php';

return $template_path;
}

and checking the params on that page. I’m sure there is a more elegant way to do this but it works for me. 🙂