Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Email attachment filename from field?

Post Reply
jmusther
Posts: 10
Joined: Thu Jan 10, 2013 4:51 am

Email attachment filename from field?

Unread post 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
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Email attachment filename from field?

Unread post 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" );
}
Post Reply