Expand my Community achievements bar.

SOLVED

How do I pull information from a text field into my email subject line using an email submit button?

Avatar

Level 2

I know how to create an email button with a static subject line, but I need to pull the name field into the subject line.

I am using LiveCycle Designer ES2 v. 9.0 on a Windows machine.

Example: Change Request for <text field from form>

1 Accepted Solution

Avatar

Correct answer by
Level 5

Not in the XML-File, only in the Click-Event of the Button.

You will find the scripteditor about "window" | "scripteditor".

There you can change the event right beside "show".

View solution in original post

5 Replies

Avatar

Level 5

Use the following script in the Click-Event.

Important: You have to use a normal button, control type regular.

//you can also fill the other parameters, for example var Mailto = Textfield2.rawValue

//this is the same var CC = Textfield4.rawValue...

var Mailto = "test@test.de";

var BetreffSubject = Textfeld1.rawValue;

var NachrichtMessage = "This is a testmessage\rSecond line starts here";

var CC = "test2@test.de";

var BCC = "test3@test.de";

var Mail = "mailto:" + Mailto + "?Subject=" + BetreffSubject + "&Body=" + NachrichtMessage + "&cc=" + CC + "&bcc=" + BCC;

event.target.submitForm({

cURL: Mail,

bEmpty: true,

cSubmitAs: "XML"

});

I hope it was helpfull for you,

Mandy

Avatar

Level 2

How do I fit that into this:

<field name="EmailSubmitButton1" y="0mm" x="136.525mm" w="34.925mm" h="6mm">

            <?templateDesigner isEmailSubmitObject true?>

            <ui>

               <button/>

            </ui>

            <font typeface="Myriad Pro"/>

            <caption>

               <value>

                  <text>Submit by Email</text>

               </value>

               <para hAlign="center" vAlign="middle" spaceAbove="0pt" spaceBelow="0pt" textIndent="0pt" marginLeft="0pt" marginRight="0pt"/>

               <font typeface="Cambria" baselineShift="0pt"/>

            </caption>

            <border hand="right">

               <?templateDesigner StyleID apbx2?>

               <edge stroke="raised"/>

               <fill>

                  <color value="212,208,200"/>

               </fill>

            </border>

            <bind match="none"/>

            <event name="event__click" activity="click">

               <submit format="pdf" textEncoding="UTF-8" target="mailto: test@test.com?subject=Site Verification Report for "/>

            </event>

Avatar

Correct answer by
Level 5

Not in the XML-File, only in the Click-Event of the Button.

You will find the scripteditor about "window" | "scripteditor".

There you can change the event right beside "show".

Avatar

Level 2

You are the best! 

Thank you for your patients with me while I am learning.

Avatar

Level 5

You're welcome.

Great. I'm happy for you that it works.