Dannymh
Active member
I am building out reports in PDF that I then move to internal data using
The process starts by building a temp file and then copying it across with the above. This all works fine. However I am confused on how exactly I access this when I want to use that file as an attachment.
I have the following which works if I run ->send. However if I run ->queue it will fail
Is there a way to just use that abstracted path straight as
Rather than having to go through creating a temp file again just to attach it and so that I can use it in queue?
\XF\Util\File::copyFileToAbstractedPath($theFile, 'internal-data://my/Reports/report' . $thread->thread_id . '.pdf');
The process starts by building a temp file and then copying it across with the above. This all works fine. However I am confused on how exactly I access this when I want to use that file as an attachment.
I have the following which works if I run ->send. However if I run ->queue it will fail
PHP:
$tempReportFile = \XF\Util\File::copyAbstractedPathToTempFile('internal-data://my/Reports/report' . $thread->thread_id . '.pdf');
$attachment = \Swift_Attachment::fromPath($tempReportFile);
$attachment->setFilename('report' . $thread->thread_id . '.pdf');
$mail->getMessageObject()->attach($attachment);
Is there a way to just use that abstracted path straight as
Code:
$mail->getMessageObject()->attach('internal-data://my/Reports/report' . $thread->thread_id . '.pdf');
Rather than having to go through creating a temp file again just to attach it and so that I can use it in queue?