Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Subject line in e-mail

Avatar

Level 1

I want to use a field from a fill-able form to populate the subject line.

I know "Subject = text" will put "text" in the subject line, what code do I use to add "OBM+(field desired)"

(field desired) is a six digit number.

3 Replies

Avatar

Level 10

Hi,

Here is a sample. The script is in the click event of the button.

var vEmail = "email@address.com";

var vSubject = "A Subject for your email";

var vBody =  "Put your body message here...";

event.target.app.mailMsg({

bUI: true,

cTo: vEmail,

cSubject: vSubject,

cMsg: vBody

});

In the script the vSubject refers to the .rawValue of a textfield. Also note that I test the values of the fields first to make sure that they are not null.

Hope that helps,

Niall

Avatar

Level 1

I am using Acrobate & Designer 7 so you know.

The script you posted does not look like xml this is what I already tried-

<submit format="xml" target="mailto:obm.freezewaivers at mystate?subject=NumaricField1.rawValue" textEncoding="UTF-8"/>

Can you still see the xml in Acrobat 9?? Can you copy the code from there?

Avatar

Level 10

Hi,

You can view objects (such as a submit by email button) in the xml source tab. However you would not tend to input script in the xml source tab.

When you open the form in the design view, you should see the script editor window. You can open the script editor via the Window menu or Control+Shift+F5. Then drag the bottom of the script editor window to make it bigger.

This is where you would insert specific script for objects on the form, against different events and languages.

Paul Guerette has several examples in a form here: Re: Variable E-mails in the e-mail button function

With LC 9 you can still view the xml source window and it looks like you have amended the xml source of a submit by email button. This is unlikely to work, so I would recommend Paul's solutions.

Hope that helps,

Niall