Delete files after email sent
Posted: Thu Jan 05, 2023 2:07 pm
Hello,
I would like to delete files in attachments once the email sent.
Here is my php code
It seems that nuDeleteFiles() is not working. It isn't documented and therefore I don't know how to use it. I haven't found any function function nuDeleteFiles in the code.
Any idea ?
Many thanks,
Yves
I would like to delete files in attachments once the email sent.
Here is my php code
Code: Select all
$file = "#filename#"; // get Filename
$filename = basename($file); // file name only
$to_email ="#fac_client_email#";
if(file_exists($file)){
nuSendEmail($to_email,'$from_email','username','object','content',[$filename => $file],true);
nuDeleteFiles($file);
// Send E-Mail
}else{
nuDebug('Cannot send ' . $file);
}
Any idea ?
Many thanks,
Yves