1 Reply Latest reply on Apr 28, 2011 12:49 PM by R12GS

    Pdf Script for email

    BERGSTEN

      Title

      Pdf Script for email

      Post

      Hi guys,

       

      I was wondering if there's a way in FMP7 that I can create a container field that has the pdf of the invoice i'm looking at that I can make attach to an email from the same invoice.

       

      So for example:

       

      I need to send this invoice as a pdf to Joe@email.com. I have the container with the pdf and a button next to the email field to open my email client with the  address in the To field. I'd like to make it so that when the email opens, the invoice is already attached...

       

       

      Thanks!

        • 1. Re: Pdf Script for email
          R12GS

          .....14 months late reply 8-)

          I just finished this script with some forum help (THANKS Phil !), and it works.   It puts a .pdf on your desktop and emails that .pdf to your customer.  The pdf details in "Save Records as PDF" were created by filemaker pro.

          =============

          Set Variable [ $pdf_filename; Value:"invoice_" & Product_Sales::Invoice_ID & ".pdf" ]

          Set Variable [ $path; Value:"file:" & Get ( DesktopPath ) & $pdf_filename ]

          Save Records as PDF [ File Name: “$path”; Current record ] [ Document - Title: "Invoice " & Product_Sales::Invoice_ID; Compatibility: Acrobat 5 and later ] [ Pages - Number Pages From: 1; Include: All pages ] [ Security - Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] [ Initial View - Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ]

          [ Restore; No dialog ]

          Send Mail [ Send via E-mail Client; To: Product_Sales::inv_ship_email; Subject: $pdf_filename & " to " & Product_Sales::inv_ship_attn & " " & Product_Sales::inv_ship_company; Message: "Attached is a PDF of invoice : " & Product_Sales::Invoice_ID & " Invoice date: " & Product_Sales::Invoice Date & " Ship date: " & Product_Sales::Date shipped & "¶If you have any questions, please contact:¶(you)@yourcompany.com¶1(800) xxx-xxxx¶1-(xxx)xx-xxxx¶¶"; Attachment: “$path” ]

          [ No dialog ]

          Show Custom Dialog [ Title: "Message from: " & Get(ScriptName); Message: "Company 'Receipt' " & Product_Sales:: Invoice_ID & ".pdf

          ¶was sent to email: " & Product_Sales::inv_ship_email & "¶This pdf file is placed on your desktop. Since the email has been sent, you can delete the pdf anytime.¶" & $path; Buttons: “OK” ]