What is the attach file field used for in the mailing template? I would like to use this to mail a PDF of a customer's invoice as an attachment. Can this be used somehow to do this? I want to create a template for sending the attached invoice, but the attachment will change for each mailing.
If I create a script to create the PDF and use the mail script step to attach it, where do you suggest I save the temporary PDF file, for a PC and Mac?
Thanks.
Attach file in mailing template?
5 posts
• Page 1 of 1
Posts: 28
Joined: Sat Nov 10, 2007 6:33 pm Location: Beaverton, OR |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
That is exactly what the attached file in Mailings is for. But if you just want to script the emailing of a PDF of your invoice, then you don't need to use our mailing component, which is more about sending a merged mail (with the same attachment) to a group of contacts.
You can do all this right in your print invoice script. Edit the beginning of your print script by defining the name and location of the file you want to print. Something like: Set Variable [ $Path ; "file:" & Get ( DesktopPath ) & "YourInvoice" & ".pdf" ] You can replace "YourInvoice" with the customer's name, your invoice number, or whatever you need. Then in your Save Records as PDF script step (where you make the pdf) simply use $Path in the specify output file option. Then when you send the email, in your Send Mail script step, use $Path again in the Specify option to the right of "Attach file". Note that if you name each PDF separately, you'll end up with a bunch of these on your desktop. You you might want something like Get ( FileMakerPath ) & "Invoices/YourInvoice" providing you've created a folder called invoices inside your FileMaker Pro 9.0 folder. Hope that helps. John Sindelar
SeedCode |
Posts: 28
Joined: Sat Nov 10, 2007 6:33 pm Location: Beaverton, OR |
Thanks John, that was the answer I was looking for. I'm going to modify the Print script like you said and use the Get (TemporaryPath) to save the PDF temporarily before I attach it and send it with the send email script step.
Thanks again. |
Posts: 28
Joined: Sat Nov 10, 2007 6:33 pm Location: Beaverton, OR |
John,
So after looking at the Send Mail script step that can send multiple emails, is it possible to have this script step send a different attachment with each email? Can the $path variable change during the Send Mail step? I could make the PDF's in the temp directory and name them based on the Invoice number so they would be unique, but can the attachment path change during this step, or do I have to create a Loop? Thanks. |
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
You'd need to create a loop. =(
John Sindelar
SeedCode |
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests