Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Textfield Title to populate in the subject line of a email button

Avatar

Level 3

I need for the a textfield title to automatically populate in the subject line of the email button

What code goes in sub = ?

 

var sub

sub =

var ebody

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 5

Its probably just as easy to use one single normal button with the following

var sSubject = CTitle.rawValue;

var sBody = <SomeField>;


event.target.submitForm({
    cURL: "mailto: Kat.Art.ctr@mdd.mil;?cc=Don.Bough.ctr@mdd.mil,SPCOHSCITSupportTeam@mdd.mil;&subject=" + sSubject + "&body=" + sBody,
    bEmpty: true,
    cSubmitAs: "PDF",
    cCharset: "utf-8"
});

use ? for the first parameter and & for each subsequent ones in mailto

View solution in original post

3 Replies

Avatar

Level 3

I created two buttons - one named "Real Email Button"(submit) and one named "Submit Button (regular)"

Real Email button has the addresses listed and the "Submit As" set to PDF:

Submit Button has the following code:

 

Button2.event__click.submit.target

= "mailto:Kat.Art.ctr@mdd.mil,?cc=Don.Bough.ctr@mdd.mil; SPCOHSCITSupportTeam@mdd.mil?subject= " +

CTitle.rawValue;

Button2.execEvent("click");

I would like the textfield title (CTitle) to automatically populate in the subject line - what is missing in my code?

Thanks

Avatar

Correct answer by
Level 5

Its probably just as easy to use one single normal button with the following

var sSubject = CTitle.rawValue;

var sBody = <SomeField>;


event.target.submitForm({
    cURL: "mailto: Kat.Art.ctr@mdd.mil;?cc=Don.Bough.ctr@mdd.mil,SPCOHSCITSupportTeam@mdd.mil;&subject=" + sSubject + "&body=" + sBody,
    bEmpty: true,
    cSubmitAs: "PDF",
    cCharset: "utf-8"
});

use ? for the first parameter and & for each subsequent ones in mailto

Avatar

Level 3

Thank you sooooo much!!!!!

I have been messing with this form for 2 hrs!