Page 1 of 1

Email attachment filename from field?

Posted: Wed Jan 23, 2013 10:23 pm
by jmusther
Hello,

I have a form on which I've added a custom button to call a report. The JavaScript looks like this:

Code: Select all

emailIt("receiptrpt","","info@domain.co.nz","Subject","Body of message","Receipt.pdf",true,"PDF")
Is it possible to insert some JavaScript so that I can format the filename to be something like:
Receipt-342.pdf

I don't believe hash variables are supported here, but something along the lines of this would seem appropriate.

Code: Select all

emailIt("receiptrpt","","info@domain.co.nz","Subject","Body of message","Receipt'#id#'.pdf",true,"PDF")
Thanks in advance

Re: Email attachment filename from field?

Posted: Thu Jan 24, 2013 3:07 am
by shane
this is how I do it:

put a button on the screen that calls a bit of JavaScript that looks like the following

function doYourThing() {
var daCode = document.getElementById('tra_number').value;
var daEmail = document.getElementById('invoiceEmail').value;
emailIt("InvGPDF",daEmail,"shane@nubuilder.com","Re-sending Invoice"+daCode,"Please see attached invoice #"+daCode, "invoice"+daCode+".pdf" , true , "PDF" );
}