3 Replies Latest reply on May 17, 2010 2:08 PM by jbone664

    Gather email from Form to submit PDF attachment.

    apoc_freud

      Hello all.

       

      First off, I am a Javascript noob, but am pretty good at figuring things out. This is what I am attempting to do:

       

      I have several forms that our office uses for tracking mileage, new employee hire stuff, etc. I'm trying to set the office up to use digital signatures, and decrease the amount of paper waste.

       

      I have the forms created, and at the top have two buttons, print, and Send form. On top the of the Send Form button, I have a text field where I want people to be able to put an email address in, and when they press Submit Form, it will load up their Outlook and already have that email filled in.

       

      I'd also like the option of using a drop down menu as well on certain forms.

       

      I am having trouble getting the coding right. Eventually I'd like to be able to determine the subject line and body of the email as well, but at this point I'd settle for getting it to load up outlook with the email that was typed into the form "Destination" or, as on certain forms, whatever value is selected from the drop down menu.

       

      I can set up a submit button to a pre-determined email easily, but I need something beyond that now.

       

       

      Thanks for any and all help!

       

       

      Regards,

       

       

      Dylan

        • 1. Re: Gather email from Form to submit PDF attachment.
          jbone664

          I have a very similar problem and its driving me crazy.

           

          I want to use text entered on the form as the subject of the email to be sent to a predefined email address..

           

          I have posted a question in the LiveCycle forums so if someone answers there i will post the answer here so you can see it as it should be an indentical procedure for what your are after.

          • 2. Re: Gather email from Form to submit PDF attachment.
            apoc_freud Level 1

            I think I figured it out. Here is what I use to pull the email address:

             

            var mailTo = this.getField("DeliveryCombo").value;

            var subject = "Mileage Report for " + this.getField("EmployeesName").value;

             

            var msgBody = "Here is my mileage report for you.";

             

             

             

            this.mailDoc();

             

             

            If you look at the var subject line, you will see that I have the first part of the subject as static (Mileage Report for ) and then I have it pull the name from the EmployeesName field to complete the rest of the subject.

             

            When someone clicks send, it generates and email to the email address they typed in or selected from the combo box, puts the subject line as Mileage Report for (name of employee), and generates that short part in the body. Finally, it attaches the PDF in full to the email.

             

            I hope this helps. Let me know if it doesn't and we'll see if we can figure something out.

             

             

            Dylan.

            • 3. Re: Gather email from Form to submit PDF attachment.
              jbone664 Level 1

              Sorry i didnt reply in here mate,

               

              I figured out how to do what i was after.

               

              var oJobCode;
              var oSubmit;
              var oSubject;
              var oBody;
              oJobCode  = form1.Page1.JobCode.rawValue;
              oSubmit =  form1.Page2.TrdsRspn.rawValue;
              oSubject = "Job Code: "+ oJobCode;
              oBody  = "Works Report Submitted by: " + oSubmit;
              event.target.mailDoc({bUI:  true,cTo: "xxxx@xxxx.com",cCC: "",cSubject:  oSubject,cMsg: oBody});

               

              JobCode is a textbox

              TrdsRspn is a texbox

               

              Using those 2 inputs from the field i generated the mail command.

               

              Just hack to suit.

               

              Jason