Pro Reports - Custom name for PDF file


Robin Herold

8 months ago

I would find it very handy if the download file of a Pro Report could be given an adjustable name or, for example, be named after the name of the site / customer



7 months ago

Yes ! To be named after name of the website would be very helpful !

Ken Sim

3 months ago

I agree. Sending out a report to the client with a file name of por-report-xxxx-xx-xx.pdf looks very canned and impersonal to the client. This report would hold more value to the client if the report was more personalized to name the pdf like like "clinet-name_custom-care-report_xxxx-xx-xx". To the client, it would feel like it was tailored for them.

Keith Crain ( MainWP Staff )

11 days ago

Just a tip, this is already achievable as MainWP Sits. simply use this code snippet here within the MainWP Custom Dashboard Extension & tweak the "return line" to your liking:

return $website->name . '-' . 'new-file-name.pdf';
return $website->name . '-' . 'what-ever-you-want.pdf';

This will output 'child-site-name-what-ever-you-want.pdf'

P.s. to add the date back onto the file name you will need to pull in that variable like so:

$suffix = date( 'Y-m-d' ); // 2020-11-11

return $website->name . '-' . 'new-file-name' . '-' . $suffix . '.pdf';

Powered by Convas