How do I get the invoice number in de pdf name

Hi there,
I’m looking for a way to get the invoice number in the name of the invoice pdf file.
Best way would be if it was generated at the sending invoice as pdf.
Is there anyone to help me out?
Greetings Mirko

I assume you want to send out based on an Email Template, with an attachment? Where are you sending this from?

PowerReplacer let’s you do this and use different file names, create the attachment on the fly, make attachments conditional, etc.

But I think none of that is possible out-of-the-box. Should be possible with a little tweaking of the code. If you are a developer I can try to provide further help on that, after you explain your situation a little better.

Hello Mirko,

You can get pdf name as invoice number by changing code at
You will have a variable called $file_name line no around 143.

1 Like

Thank you! this seems to work :slight_smile: