Jochen Fritsch Posted August 11 Share Posted August 11 Hi everyone, I tried a lot, but I don´t know if I´m on the right track. I hope, someone can help. I store orders in pages. Every order has a FileField "invoice_pdf". To prevent public access to the PDF, the page template has a pagefileSecure setting and no viewing rights for guest role. The files are then saved unter /site/assets/files/-XXXX/ -> the - prefix is part of the pagefileSecure setting, I guess. Now I want to send the PDF as mail attachment to my customer. But the PDF->url / PDF->httpURL() contains the path without the - prefix. The mail is sent without attachment. I guess because the real path doesn´t countain a file. Is it possible, to send attachment-files, uploaded to a pagefileSecure field? Thanks a lot for your help! Link to comment Share on other sites More sharing options...
BitPoet Posted August 11 Share Posted August 11 You should use $pdf->filename, not $pdf->url. 1 Link to comment Share on other sites More sharing options...
Jochen Fritsch Posted August 11 Author Share Posted August 11 Thanks @BitPoet 🙂 That was the problem. $file->filename uses the whole (system)-path and the attachement gets added to the mail Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now