<?php

namespace GemBoards\utils\traits;

use GemBoards\Utils\Helper;

trait Email {

	public static function get_email_body( string $template, array $args = [] ) {
		ob_start();
		Helper::get_template( "emails/$template.php", $args );
		$invitation_content = ob_get_clean();

		ob_start();
		Helper::get_template( 'emails/template.php', [
			'content'           => $invitation_content,
			'avatar_url'        => $args['avatar_url'],
			'user_display_name' => $args['user_display_name'],
		] );

		return ob_get_clean();
	}

}
