8 Replies Latest reply on Oct 12, 2009 2:42 PM by Jo_2005

    Email Without Attachments by mailDoc or Web link

    Jo_2005 Level 1

      Hello,

       

      I have a script assigned to a signature field which is executed once the signature has been signed.

       

      This script will generate an email to a predefined recipient.

       

      Once the script has been executed the email has the pdf file included as an attachment.

       

      As the pdf file is located on the network server it is required to have a link to the pdf file in the body of the email and not as an attachment.

       

      Can the script be modified to accommdate the requirements?

       

      The script is as follows:

      this.mailDoc({
      bUI: false,
      cTo: "xyz@companyname.com",

      cSubject: "Check Calculations",
      cMsg: "Sign Calculations from the following link C:\Documents and Settings\name\My Documents\Calculation.pdf."
      });

       

      Another method I have tried is to have a set action in the signature field to "open a web link" eg mailto: xyz@companyname.com

       

      This will call up an email message without the attachment, but the subject and body of the message are blank (these fields need to be predefined as noted in the above script).

       

      Can anyone please advise how to modify the script or advise the method to send an email without an attachment and include a predefined subject with a link in the body of the message?

       

      Any assistance would be most appreciated.

       

       

        • 1. Re: Email Without Attachments by mailDoc or Web link
          try67 MVP & Adobe Community Professional

          app.mailMsg()

           

          (Be aware: this will not work in Reader)

          • 2. Re: Email Without Attachments by mailDoc or Web link
            Jo_2005 Level 1

            Thank you so much for your help, the change to the code in the script works perfectly, I am very happy with the results.

             

            I have worked out how to include a hyperlink in the body of the message so it opens the file,  I was having difficulties because the message is generated in plain text, not HTML format.

             

            Can I please ask for further assistance in regards to how to code the script to place a carriage return in the body of the email ?  That way the message will look less confusing if on separate lines instead of one long paragraph of text.

             

            The amended script is as follows:

             

            app.mailMsg({
            bUI: false,
            cTo: "
            xyz@companyname.com",

            cSubject: "Check Calculations and Sign as Approved",
            cMsg: "Please Sign Calculations from the following link:   
            file:///C:/Documents%20and%20Settings/name/My%20Documents/.pdf.  Best Regards  Name & Company"
            });

             

            Thank you one again for your help, it has been most appreciated.

             

             

            • 3. Re: Email Without Attachments by mailDoc or Web link
              try67 MVP & Adobe Community Professional

              A line break in JavaScript is \n

              About hyperlinks: I guess you can try to include a HTML tag, but it depends on the email application/website of your recipient if it would be displayed properly.

              I think most clients/sites are smart enough to convert a plain text URL to a hyperlink.

              1 person found this helpful
              • 4. Re: Email Without Attachments by mailDoc or Web link
                Jo_2005 Level 1

                Thank you very much for your help with the line break code for the body of an email message.  This has worked very well.

                 

                I am having difficulties in regards to a HTML tag for the hyperlink.

                 

                I have included a <a href> tag, but this does not function as a code, it puts the code in as text in the message.  There is a HTML body tag missing, but I an not sure where to place this in the script.

                 

                Can you possibly please help with how I can piece together this final piece of code?

                 

                The script is as follows:

                 

                app.mailMsg({
                bUI: false,
                cTo: "
                xyz@companyname.com",

                cSubject: "Check Calculations and Sign as Approved",
                cMsg: "Please Sign Calculations from the following link: \n

                <a href>'file:///C:/Documents%20and%20Settings/name/My%20Documents/.pdf',Calculation link</a> \n

                Best Regards \n

                Name & Company"
                });

                 

                Thanks once again for your valuable input.

                 

                • 5. Re: Email Without Attachments by mailDoc or Web link
                  try67 MVP & Adobe Community Professional

                  Your tag is not correctly formatted. You can read about HTML standards here:

                  http://w3schools.com/html/html_links.asp

                  • 6. Re: Email Without Attachments by mailDoc or Web link
                    Jo_2005 Level 1

                    Thank you for your help.

                     

                     

                    I have decided to go by another option insead of HTML tag using the URL variable .

                     

                    Correct Script for manually placing set action inside signature field

                     

                    app.mailMsg({
                    bUI: false,
                    cTo: "
                    xyz@companyname.com",

                    cSubject: "Check Calculations and Sign as Approved",
                    cMsg: "Please Sign Calculations from the following link:\n\n" +  this.URL,

                    });

                     

                    This script works well when manually placed as a set action inside of the signature field.

                     

                    However, when the same script is placed in a batch processing script the \n\n does not work any more.

                     

                    After the batch script is run the \n\n line feed have been placed in the signature fields as blank lines and are no longer showing the code and the set action does not work.

                     

                    Can you please advise how to code line feeds when placing scripts in batch processing?

                     

                    Script when placed in batch processing (with line feeds as \n not working)

                     

                    var g = this.getField("Preparedby");
                    g.setAction("MouseUp", "var g =  app.mailMsg({bUI: false,cTo:
                    xyz@companyname.com,cSubject: Calculation for Checking and Signing',cMsg: 'Please check and sign the document for the Calculation from the link as follows:\n\n' + this.URL,});");

                     

                    Your continued assistance is very helpful, thank you.

                     

                     

                    • 7. Re: Email Without Attachments by mailDoc or Web link
                      try67 MVP & Adobe Community Professional

                      Since this is now a string within a string you have to double-escape the line-breaks.

                      Try using \\n instead of \n.

                      1 person found this helpful
                      • 8. Re: Email Without Attachments by mailDoc or Web link
                        Jo_2005 Level 1

                        Thank you very much for your help, the batch processing script will now add a set action to a signature field.

                         

                        Once the signature field is signed, an email message will be generated with a predefined recipient, the subject will have a default heading, and the body of the email will have a message and a link to the active file on the network.  The key to the script is the app.mailMsg and this.URL variables.

                         

                        I have included the batch processing script for reference as follows:

                         

                        var g = this.getField("Preparedby");
                        g.setAction("MouseUp", "var g =  app.mailMsg({bUI: false,cTo:
                        xyz@companyname.com,cSubject: Calculation for Checking and Signing',cMsg: 'Please check and sign the document for the Calculation from the link as follows:\\n \\n' + this.URL,});");

                         

                         

                        I appreciate the assistance you have given to complete the script successfully, have a nice day!