May 1, 201213 yr Hi, I hope someone can help. I have a database that has a layout with seven coupons in it. Each coupon has a first name and last name field as well as a non-printable email address field. I want to have Filemaker create a PDF for EACH of the email addresses/records. So basically, the pdf would look the same to everyone, except their personal name would be in the fields and ONLY sent to THEIR email address. So far, I can either send one email to the current record or everyone's pdf to everyone. I am not real good at writing scripts. Basically, right now the file is called test.fp7 and the fields are "first name", "last name", "email" and "date". If the customers name is "John Doe" I want the layout in the PDF, with "John Doe" in the name and sent to John Doe's email address and so on through the found set. I would be sending the email from the found set of records, so it could be 5 records or 500. Any help would be greatly appreciated. I sold Macs for 15 years from 1984-1999 and have used Filemaker a lot, but never to send emails and I am stumped. I tried to attach the file but it won't let me. It only has 2 records in it to test right now, but I still couldn't attach it. Thank You, Jim
May 1, 201213 yr Automatic message This topic has been moved from "Database Schema & Business Logic → Importing & Exporting" to "The Presentation Layer → Reports, Printing & Publication → Email".
May 1, 201213 yr You would need to loop through the records. Also if you want to send them without using an email client, you would need to set up the SMTP settings. Your script could look something like ( where contacts is your contacts table ) : Go to Record [First] Loop Set Variable [$exportPath; Get ( TemporaryPath ) & "Coupon" & contacts::ID & ".pdf" ] Save Records As PDF [ $exportPath; CurrentRecord ] Send Mail [ SMTP Server ] // name your $exportPath as your attachement location here Go to Record [ Next; Exit after last ] End Loop
May 2, 201213 yr Author Thanks for the reply. I am stumped as to where to type all this stuff in. I used the "set variable" command in the script. When I double click on it a box pops up with "name" "value" "Repetition" and the last two have a "specify button" next to them. HELP lol The name of my file is "test", the layout I want included in the PDF is "Coupon". The fields are "first name" "last name" "date" "email address" "email address" field is non-printing This is the mess I created :sad:
May 2, 201213 yr $exportPath goes in the name entry box. Get ( TemporaryPath ) & "Coupon" & contacts::ID & ".pdf" goes in thevalue entry box. Leave repetition alone with the default 1
May 2, 201213 yr Author Thanks again. I had it that way. The only issue is ID It says field can't be found. This is what I have. Test is the table name and coupon is the layout name. ARGHHHH. I thought this would be easy lol Get ( TemporaryPath ) & "Coupon" & test::ID & ".pdf"
May 2, 201213 yr Author “$exportPath; CurrentRecord” could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk. I have it where it creates an email for each name in the database and puts in a subject, but I cannot get the layout to be created in a PDF with the fields. It simply creates new emails with a subject. Can I send you an electronic beer if you get this to work for me? Thanks!
May 2, 201213 yr Author also I have no field "ID" like you mention. I have one layout with the fields I mentioned: The fields are "first name" "last name" "date" "email address" ......."email address" field is non-printing. Also I have no relationships. Thanks AGAIN
May 3, 201213 yr You missed some crucial information. Take a look at the modifications that I made to your file and then compare it to your orig one so that you understand. test_MOD.zip
Create an account or sign in to comment