Create a new page in a plugin

I managed to do it, not perfect but it works…

add_action('template_redirect', 'my_template');

function my_template(){
global $post;
if( get_post_type($post->ID) == 'courses'){
include(ABSPATH. 'wp-content/plugins/courses/single-course.php');
}

And the file the include points to is my new template file in the plugin.