Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

PDF form - email subject line = field

Avatar

Level 3

[Thread Edited By Adobe]

/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here

Go ahead and to it now: https://adobe.ly/3eDnB4v */

 

Actual Question:

I am creating a PDF form on our intranet to be filled out and submitted via email with a submit button. All works well, but the recipients would like the subject line of the email to be info from the first field on the form so that it is easily searchable. I am using Adobe LiveCycle Designer 8.0 (also have Acrobat 8 Professional) but haven't found anywhere to edit this info.  I have read thread referencing possible solutions by utilizing javascript, but I'm not sure where to begin where javascript is concerned (not my forte).
 
Right now the form is Submitted by Email via a "Button" set to Control Type: Submit. Under the Submit tab I have set the Submit to URL field to - mailto:"emailaddress".

 

Also, the recipients mentioned that they can't see the PDF in the body of their email, instead its only an attachment. We are all using Outlook and Outlook Webmail and would like to see the PDF in the body.  Is there an easy way to accomplish this as well?
 
Any helpful suggestions would be greatly appreciated!
1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You have the script set for FormCalc but that script is Javascript. In the script editor change the language dropdown (right hand side) to Javascript.

Paul

View solution in original post

65 Replies

Avatar

Former Community Member

I created a sample that deals with lots of different email issues. You can tackle this in many different ways. Have a look at the sample and see if it meets your purposes.

Paul

Avatar

Level 3

Thanks for the fast response Paul.

Ok I've successfully managed to edit the subject line as follows

Submit Button>Submit Tab>Submit to URL: mailto:[emailaddress]?subject=

However, from here ... how do I make the subject = [text]+TextField1 < example > subject would read - Request for [Jimmy Smith] >[textfield1]

Sorry if I'm making this seem more difficult than it is.

Many thanks for any help given.

Avatar

Former Community Member

You cannot do it in the URL of the button. That will not interpret commands it is just a raw URL. If you look at the last XFA example with the hidden button you will see some javascript behind the button theat you press. This code sets th eURL programmatically where I can read other fields and make up a URL.

Paul

Avatar

Level 3

Paul,

Due to me needing this form to be submitted in PDF format, I can't use the Submit by Email button.  How do I go about viewing the Javascript code and editing it to suit my needs in LC Designer 8.0?

Again, as a novice, I apologize if this is trivial knowledge, but JS is new territory for me.

I really do appreciate you taking the time to explain this to me.

Thanks!

Avatar

Former Community Member

You might be better off using the Acroform method in that document ....the script is behind click event of the button. In Designer, highlight the button. Then under window ensure that the script editor is opened. It should be on top of the form display but below the menu bars. On the left side is a dropdown (called Show) that allows you to pick the event. Anything that has script behind will show with an *. Choose the click event. The code shodul be there.

Paul

Avatar

Level 3

Ok, now we're making some progress, but now I have a syntax error.  (see attached screenshot)

I'm so close I must be missing something right under my nose.  Any suggestions?

Your time and patience is appreciated.

Avatar

Correct answer by
Former Community Member

You have the script set for FormCalc but that script is Javascript. In the script editor change the language dropdown (right hand side) to Javascript.

Paul

Avatar

Level 3

.... Like I said ... right under my nose!

Many thanks Paul!  You have been a great help!!!!!!!

Works perfectly.

Avatar

Level 1

I need to email submit and have one of the field inputs like an address appear in the subject line and also in the attached file name. Does anyone have any suggestions?

Thanks for any suggestions.

Chris

Avatar

Former Community Member

You wopn't be able to change the filename unless you save the file first. Here is an example of a number of ways to deal with parts of the email programatically.

Paul

Avatar

Level 1

Thanks Paul.  I think I have a button that will work from your great attachment.  On the saving issue.  Do you have any thoughts on any code that might auto save 'behind the sences so to speak' to a users temp file and then pick up the email submit without the user having to save it and then go get it to email?

Thanks again for your expertise!

Chris

Avatar

Former Community Member

If you are using an email client then the autosave is happening automatically for you. If you are using a web client for email then you can have a button that will save the form but you cannot automatically do this. You can bring up the dialog for the use but you cannot choose a filename and save without th eusers knowledge  - that woudl be a breach of security!

Paul

Avatar

Level 1

I found this thread very informative, however, the examples given don't seem to detail the same issue I'm having.  Similar to the first example, I have a PDF from with a button at the bottom that says "Click here to Submit Form" and on the back side it is a simple Mailto:email@email.com  The document Paul provided helped me see where I can specify the subject using Java but what syntax do I input to call the contents of a field from the form as the first portion of the subject?

If there if a Field on my Form called "ApplicantLastName"  I'd like for the Contents of that filed to be part of the Subject of the email sent so the Subject would ultimately be "Doe-NEW-Access-Request" where the word "Doe" is the content of the "ApplicantLastname" field.

This may have been covered in this thread and I'm just blind and not grasping it, if so please feel free to beat me with a wet noodle and point it out....Any help would be appreciated.

Avatar

Former Community Member

In that example file the 3rd one puts a users name (from a Dropdownlist) into the command. You can use the same technique to manipulate the subject. It woudl be something like this:

RealEmail.event__click.submit.target =

"mailto:" + DropDownList1.rawValue + "?subject=" + ApplicantLastName.rawValue + "-NEW-Access-Request";

Paul

Avatar

Level 1

With some other help in the forums the following code behind the button seems to do what I need it to.  The only issue I'm having now is getting this email button to actually attach the PDF form to the email.  I'm also trying to get it to pull data from two fields (Applicant Last Name and Applicant First Name) but the syntax eludes me....

topmostSubform.Page1.Submit_Button::mouseUp - (JavaScript, client)

/*var myFieldData = this.getField ("APPLICANT LAST NAME");

var mySubjectName = (myFieldData.valueAsString);

app.mailMsg(false, TEST@TESTEMAIL.COM, "", "", "Access Request for"+mySubjectName, "Please process the attached form for acess.");

Avatar

Former Community Member

It woudl be easier if you would post your form.

Paul

Avatar

Level 1

Here is a sample form, now the subject change test button I created won't even work and I'm not sure why...

Avatar

Former Community Member

You are mixing Acroform scripting with XFA scripting ....here is a revised copy.

Paul

Avatar

Level 1

I am having trouble opening up your example using the Acroform method from your attachment. Do you know any reason why this would be? I am looking at attaching a recruitment number to the subject line when an applicant submits an application.

Thanks for any help.

Aaron

Avatar

Former Community Member

Do you mean that you create an email and you cannot open the attachment in the email?

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----