I am trying to add a file to the reportmail from eForm but not a file uploaded by the user but a generated file (pdf) that i create by using the form fields.
I tryed to add it in the files array, (this works that I get a file on my server) but how do I get this file attached with the send email?
This is what I did: i called the on eFormOnBeforeMailSent
<?php
function attachFile( &$fields ){
//...more pdf stuff...
$pdf->Output(MODX_BASE_PATH . 'assets/pdf/facturen/file.pdf', 'F');
$_FILES['attachment']['name'] = 'factuur123.pdf';
$_FILES['attachment']['error'] = 0;
$_FILES['attachment']['tmp_name'] = MODX_BASE_PATH . 'assets/pdf/facturen/file.pdf';
$_FILES['attachment']['size'] = filesize(MODX_BASE_PATH . 'assets/pdf/facturen/file.pdf');
return true;
the pdf is created but the file is not attached even tho i have a [+attachment+] placeholder in the report.
any idea how i can do this?