Set file name when using an email button.
I have a invoice with an email button that will use to email a copy to my customers.
But when the attachment is sent the file name is random numbers and letters, not the same file name as the original pdf.
Is there a command that I can put in my script that will take data from the from (Invoice and Date) and use it for the file name when it sends the email?
This is the script I am using.
// Collect the Customer's Email Address
var cToAddr = this.getField("Email").value;
// Set the subject and body text for the email message
var cSubLine = "Paperwork"
var cBody = "Here is your paperwork."
// Send the first page as a file attachment in an email
var page0 = this.extractPages(0);
page0.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody}); page0.closeDoc(true);
