customizing email body on email submit button | Community
Skip to main content
Level 2
September 2, 2011
Question

customizing email body on email submit button

  • September 2, 2011
  • 20 replies
  • 39116 views

Hi everyone,

I'm trying to modify what the body of the email will look like once the user has pressed an email submit button. In Livecycle designer, I clicked on the button and viewed the xml source. I scrolled down to the following line:

               <submit format="xml" textEncoding="UTF-8" target="mailto:test&test.com?subject=My subject"/>

Then changed it to:

               <submit format="xml" textEncoding="UTF-8" target="mailto:test&test.com?subject=My subject?body=new body"/>

When I tested the button, the text "?body=new body" was appended to the subject line instead of being included in the body itself.
I wondered if anyone could tell lme where I'm going wrong?
Appreciate any help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

20 replies

February 3, 2012

Can this be customized to include field data?

Level 2
February 8, 2012

I would love to have this question answered too. Also, does anyone know how to enter returns into the email body text? Currently all I'm able to do is write the body text as one line.

February 8, 2012

What I ran across in my searching (that worked) was to create hidden fields that contained the data I wanted to use. I also used a "dummy" submit button. The "real" submit button was created as a literal submit button and the following code inserted into the click event of the "dummy" button (which is a Regular button)

This code was modified from another's answer, but does the job. The field "SUBJECT" is set as "Hidden" in the presence drop-down of the object tab. I suspect one could add '&body=' as follows

You would create the field "BODY" and insert the message text and call the formatted value to fill it in. Set the field to "Hidden" so it does not affect your form layout. I am open to being corrected by more experienced scripters (Please and thank you) if I am in error, here.

Level 2
February 8, 2012

Just to clarify, this is generating the email subject or body text and pulling data from the form fields that the end user has filled, correct?

February 8, 2012

If you choose to use fields the user has filled in, then yes. If you choose to use fields that you have filled and set to hidden, then the user will not see them, but the script WILL and it will use the data contained in them to generate the email subject/body.

March 22, 2013

Hello,

For the life of me I can not find this macro to download. The link I click on which is supposed to lead me to the macro does not work. Can you please post a link to the download. Thank you.

(MailTo maker Macro)

Mandy_Wiesener
Level 6
March 23, 2013

You can do the following:

You have to use a normal button!!

//fill in e-mail

var Mailto = Formular1.s1.email.rawValue;

//var Mailto = "test@test.de";

//fill in subject

var SubjectBetreff = Formular1.s1.betreff.rawValue;

//var Betreff = "Test-Betreff";

//fill in message

var MessageNachricht = "Content PDF:\r" + "Field content: " + Formular1.s1.inhalt.rawValue + "\rName: "

+ Formular1.s1.name.rawValue + "\rDatum: " + Formular1.s1.datum.formattedValue;

//var Nachricht = "This is a test message.\r2.row start here.\r3.row here.";

//fill in e-mail cc

var CC = Formular1.s1.emailcc.rawValue;

//var CC = "testcc@test.de";

//fill in e-mail bcc

var BCC = Formular1.s1.emailbcc.rawValue;

//var BCC = "testbcc@test.de";

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

//cSubmitAs: "PDF" send the pdf as attachment

//cSubmitAs: "XML" send the pdf as xml-attachment

event.target.submitForm({

cURL: Mail,

bEmpty: true,

cSubmitAs: "XML"

});

Hope it will helps you,

Kind regard Mandy

01371406
Level 5
June 17, 2013

I was unable to get Mandy's script (proceeding entry) to format the email text on a MS Windows Outlook email.  File attached. All the email did was populate in Plain Text.

https://workspaces.acrobat.com/?d=2uxMuZSRHwDGRLzZPoSbXw

December 10, 2013

Hello

I tried this option. It works fine. As long as the variable MessageNachricht does not contain an '&' (ampersand). If it does, the text in the body of the email will stop at that '&'.

Does anyone know how to avoid that? How can I change it to include text with '&' in the body of the email? Or it there a way to prevent people from using the '&' in the form (apart from just asking them, of course).

Thanks

Mattias

radzmar
Level 10
December 10, 2013

I don't see any problems using ampersand characters at my end.

Even rich text values are processed successfully as plain text into the mail subject and body.

I've used a macro to create the mailing script.

It simply picks values from form fields andcombines them together with a default message.

http://thelivecycle.blogspot.de/2012/05/mailto-maker-marco-v1.html