3 Replies Latest reply on Apr 30, 2009 12:38 PM by mrvodka

    Add PDF of Layout to Send Mail Script

    enyko

      Title

      Add PDF of Layout to Send Mail Script

      Post

      How do I have my mail script attach a PDF of one of my layouts to the email.

       

      Example; Email script is "Send Contract". The script creates an email with text saying "Attached is your contract...blah, blah, blah". I would like the script to attach their agreement which is one of the layouts to the email. 

        • 1. Re: Add PDF of Layout to Send Mail Script
          mrvodka
            

          Your script should go to the layout first and isolate the records that you want in your PDF. Then save the PDF into your temp directory using a variable to create the path. Next go back to the orig layout and send mail with the pdf ( the same variable ) as the referenced attachment.

          • 2. Re: Add PDF of Layout to Send Mail Script
            enyko
               Are you saying there is a way for the script to do all this you specified? Or are you saying, prior to running the script I should go into the layout, save as pdf...etc. and THEN run the script?
            • 3. Re: Add PDF of Layout to Send Mail Script
              mrvodka
                

              Yes the whole process could be scripted.

               

              Set Variable [ $path; Get ( TemporaryPath ) & pkRecordID & ".pdf"  ]     // where pkRecordID is the unique record ID, you can replace it with something else you want to name it

              Save Records as PDF [ Restore; No Dialogl $path; Records Being Browsed]    // enter file:$path under specify output file

              Send Mail []    // enter file:$path under specify attach file