Change Email PDF function: Email Subject, PDF Title etc

Hi,
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.
Thanks

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?

modules/Aos_PDF_Templates/generatePdf.php

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.


1.formLetter.php
2.formLetterPdf.php
3.generatePdf.php
4.sendEmail.php

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

:cheer:

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?
Thanks

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?