Change Email PDF function: Email Subject, PDF Title etc

When a user clicks the ‘email pdf’ button in the invoices module the email created is given the subject:
‘Invoice for’… and the attached pdf is called ‘Invoice_’.
Is there a way for me to change this?
I have multiple buttons in the invoice module and I want the generated pdfs to be called different things and have different subject lines depending on the button pressed.

Yah ajgisme,

You can do that. it is possible.

You have to write condition ,like

if( button == 'xyz'){
 $subject = 'sgsgs';
else if( ? )
  $subject ='xcvv';

Cool thanks a lot!
Where would I write this?


This is the main file, but before that you have to do som custom coding , might be there is possiblity to pass some parameters from other files.

so you have to backtrack and need to found out if u will face any problem.


see this files, most of the time you will find soultion here only.


Thanks, but this doesn’t seem to be working.
Are you sure I can use that if statement for the buttons?
It feels like I’m combining PHP with javascript which I don’t think I can do?

you Can man. but one thing i didnot understand it’s all about php. where u find javascript. By php only you can do that.

Well it’s javscript that reacts to the button press but fine I guess that’s not important for what I’m talking about.

My main point is, in the if statement what do I put the the button value? Is it the ID of the button that’s pressed?