July 11, 201312 yr Hi Folks, I have a portal of players involved in a gig. That works fine. I have a button on the layout to email all the players using my email client (Apple Mail). Clicking the button opens Mail with the appropriate subject title, but there are no recipients in the "To" of it. I've set it to send to emails from the HomeEmail field and CC to the WorkEmail field (in the same table that players come from.) Is Apple Mail incompatible or is there something else I'm doing wrong? Cheers! Mike
July 11, 201312 yr Solution Hi Mike, you need to collect the addresses from the portal, store them into a variable and then address the email to that variable. In your script go to the first portal row, start a loop, set a variable that contains the email address field from your database Go To Portal Row[Select First] Loop Set Variable[$addresses; Value: List ( $addresses ; db::email )] Go To Portal Row [Select; Next; Exit after last] End Loop Then Send Email and use the variable $addresses in the email setup as the TO address. email_LOOP.fp7.zip
July 12, 201312 yr Author Many thanks; I'll have a play when I get the chance. It will be my 1st play with scripting! Cheers, Mike
July 13, 201312 yr Glad I could help. Someone helped me with a similar problem just the other day. Just a note for anyone trying to do this with a different email program. You may run into problems with the separator between email addresses. Mail.app can work with a list such as this with no separator, other programs (Outlook, etc.,) may require a comma or colon to separate the addresses. In that case use Substitute to change the carriage returns to the separator you require.
July 18, 201312 yr Author Hmm, I seem to have broken it but can't see what I've done wrong! It's looping just over on name in the middle of the portal and attaching the PDF in an email to them - named 16 times in the To of the email. Here's my script: Go to Layout [ “Gig Details” (Set_List) ] Save Records as PDF [ File Name: “file:BIG BAND/GigInfoPDF/CurrentGigInfo.pdf”; Records being browsed ] [ Document - Compatibility: Acrobat 5 and later ] [ Pages - 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% ] Go to Portal Row [ Select; First ] Loop Set Variable [ $addresses; Value:List ( $addresses ; Players::EmailHome ) ] Go to Portal Row [ Select; Next; Exit after last ] End Loop Send Mail [ Send via E-mail Client; To: $addresses; Subject: "Swingamajig: "& Set_List::Gig Name &" - "& Set_List::Date; Message: "Dear Folks," & ¶ & "here are some details of our next gig:" & ¶ & Set_List::Gig Name & ¶ & "Date: " & Set_List::Date & ¶ & "Venue: " & Set_List::Venue & ¶ & "Postcode: " & Set_List::GigPostcode & ¶ & "Notes: " & Set_List::Gig Notes:; Attachment: “file:BIG BAND/GigInfoPDF/CurrentGigInfo.pdf” ]
July 19, 201312 yr There's no need for a loop here (unless the portal is filtered, that is). You can replace the block from Go to Portal Row down to (and including) End Loop with Set Variable [ $addresses; Value:List ( Players::EmailHome ) ]
July 19, 201312 yr Author Thanks Rio, I've just tried that, but it only finds one address (the same one as before), but this time only once!!) Not sure why that address gets chosen! Cheers, Mike
July 20, 201312 yr Author Hi Folks, It now works, but I'm not sure why!! I put Substitute ( List ( Players::EmailHome ) ; "¶" ; ";" ) in the TO: field of the write email and didn't set a variable at all. (found this in the knowledge base). Cheers! Mike
Create an account or sign in to comment