if your code is actually executed check for the value of $dir_mail
the code
if (file_exists(dirname(__FILE__).'/mails/'.$mail_iso.'/new_order.txt')
checks in the folder of the file and you don't have the files there. the files are in the actual module
if (file_exists(_PS_MODULE_DIR_ . 'ps_emailalerts/mails/' . $mail_iso . '/return_slip.txt')
for easy debug use something like
error_log(yourmessage."\n", 3, pathtolog"/my-errors.log");
to send arrays or objects json_encode is your friend