levbec Posted May 14, 2008 Share Posted May 14, 2008 Alright well of course I ran into another problem almost immediately, slightly more complicated. Now, no matter what happens the e-mails will be sent with the exported referenced attachment because it is stored in a remote folder, even if it is not currently in the container field. Original thread in export/import http://filemakertoday.com/com/showthread.php?t=17817 How do I delete a variable filepath file before the e-mail is sent out? Trying to figure it out now, but getting more frustrated as I go. Here is the current script Loop Exit Loop If [ IsEmpty ( Contact::Emailmassattachment1 ) ] Set Variable [ $$attach1; Value:GetAsText ( Contact::Emailmassattachment1 ) ] Export Field Contents [ Contact::Emailmassattachment1; “filemac:/VHG Files/General/Email Attachments/$$attach1†] Exit Loop If [ IsValid ( Contact::Emailmassattachment1 ) ] End Loop Send Mail [ To: If(not IsEmpty(Contact::EmailPrimary) ; Contact::EmailPrimary ; ""); CC: If(not IsEmpty(Contact::AssistantEmail) ; Contact::AssistantEmail ; ""); Subject: Contact::Emailmasssubject; Message: Contact::Emailmassmessage; Attachment: “filemac: /VHG Files/General/Email Attachments/$$attach1†] Set Field [ Contact::Emailmassdate1; Get(CurrentDate) ] Link to comment Share on other sites More sharing options...
AHunter3 Posted May 14, 2008 Share Posted May 14, 2008 On any given record there either IS or there is NOT a value in Contactt::Emailmassattachment1 ? Or it's one value for every record or something? If it's one value for every record why do you not want it sent out for every record, and if it's not one value for every record why wouldn't the attachment file path simply fail due to there being nothing at that path? I guess you could be more explicit and set a variable $Attachment to Case (isempty (Contact::Emailmassattachment1, "", “filemac: /VHG Files/General/Email Attachments/$$attach)] and then Send Mail blah blah blah Attachment: $Attachment which being dead empty for records you don't want attachments will mean "no attachment", yes? Link to comment Share on other sites More sharing options...
Recommended Posts