I need to make email notification for my service Written in php. So the question is: Is it correct to use ob_start() and ob_get_clean() or there is a better way?
Simple Example:
<?php
...class logics...
ob_start();
include 'email_html_tpl.php';
$msg = ob_get_clean();
Email::Send('example@example.com', $msg);
?>
Notice that all this happens in script called via ajax.