Hook for altering the content of all wp mails

Yes, there is a filter for this.

The correct filter is wp_mail and is defined in /wp-includes/pluggable.php Line 135

So the code (maybe in your functions.php) should look something like this:

function mail_template($args){

    ob_start();
    require_once (get_template_directory() . '/mail-templates/contacemail.php');
    $args['message'] = ob_get_contents(); 
    ob_end_clean();

    return $args;

}
add_filter('wp_mail', 'mail_template');

error code: 523