Skip navigation
Currently Being Moderated

customizing email body on email submit button

Sep 2, 2011 7:28 AM

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.

 
Replies
  • Currently Being Moderated
    Sep 2, 2011 7:41 AM   in reply to gwhPoster

    When using the mailto the parameters are preceded by a ? and all subsequent parameters are separated

    by an &. Also the email address needs an @ not an &. So your command woudl be:

     

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

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2011 5:27 AM   in reply to gwhPoster

    Did you just copy and paste form the forum into the script editor or did you do it some other way?

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2011 6:18 AM   in reply to gwhPoster

    It looks like you are changing the xml source directly and have introduced an error nstead of using the script editor.  If you send the form to LiveCycle8@gmail.com I will have a look

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2011 7:46 AM   in reply to gwhPoster

    Hi,

     

    if you need an easy way to design the mailTo button you can use my macro for Designer (9.x and 10.x).

    It will add a mailTo script to a regular button.

     

    http://thelivecycle.blogspot.com/2011/07/mailto-maker-macro.html

     

    MailTo.png

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2011 8:34 AM   in reply to gwhPoster

    gwhPoster:

     

    How to fix the problem? What changed?

    I need to change the body of the message and not as ...

    Please, I need your help.

     

    thanks.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2012 11:16 AM   in reply to gwhPoster

    Can this be customized to include field data?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 8, 2012 8:55 AM   in reply to DC Dowd

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 8, 2012 9:04 AM   in reply to jennie ehs

    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)

     

    RealEmail.event__click.submit.target = "mailto:person@address.com?subject=" + SUBJECT.rawValue;

    //app.alert(RealEmail.event__click.submit.target);

    RealEmail.execEvent("click");

     

    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

     

    RealEmail.event__click.submit.target = "mailto:person@address.com?subject=" + SUBJECT.rawValue + "&body=" + BODY.formattedValue;

     

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 8, 2012 9:20 AM   in reply to DC Dowd

    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?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 8, 2012 9:34 AM   in reply to jennie ehs

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2013 6:06 AM   in reply to radzmar

    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)

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 26, 2013 5:42 PM   in reply to TecMis

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 17, 2013 3:07 PM   in reply to Mandy_Wiesener

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 10, 2013 4:22 AM   in reply to Mandy_Wiesener

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 10, 2013 12:44 PM   in reply to MattiasVd

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points