Expand my Community achievements bar.

Email form submit

Avatar

Level 1

I have a form that I am having trouble with. I am new to livecycle and have very limited scripting knowledge.

The form I have is used to initate work on a project. The user fills out the form with all the information we need detailing what the project entails. What I need is for this form to be emailed to me. I can get this to work ok by using the "Email Submit Button" But I would like a little more control over the email.


I would like the resulting email to have a subject line like: PFR - "ProjectName"

(PFR is an acronym we use and "ProjectName" is the name of a field from the form.)

Also I would like the attachment to be renamed to the "ProjectName" variable if possible. Since I save the attachment for refrence later if needed.

Also I would like to change the default text that is generated for the body of the email. I honestly think the default text will confuse some of the people who will be using the form.

Can anyone help me with this.

I don't know if this helps but I also need it to be functional in Reader.

2 Replies

Avatar

Level 10

you can change the subject and cc but i'm not sure that you can change the attachment name.

See the code of the Submit button or read the help from Designer.

I will send you proper reference soon.

Nith

Avatar

Level 4

IF your form fillers have acrobat OR the form is going to be reader extended THEN

you can go wild with the email buttons

if the above assumptions are valid

try something like this

grab a normal button - not the pre-made email button and pop on it's click event put

var mail;

var address = email.rawValue; //[or whatever.rawValue equates to email text field]

var sub = subject.rawValue;

mail = "mailto: " + address + "?subject=" + sub;

event.target.submitform({

     cURL: mail,

     bEmpty: true,

     cSubmitAs: "xml",

     cCharset: "utf-8"

})

and test - hopefully so far so good

then we need to get funky with the var sub = subject.rawValue

so change the var sub line to read

var sub = ("PRF-" + subject.rawValue);

and there is your email subject dynamically specified as PRF- SCRIPT_HINT for exmaple 

where SCRIPT_HINT is the subject.rawValue

can fool about with contents too i think - but first see if your fillers are able to use these functions aye?