Jump to content

Does filemaker pro 16 have a "send in mail" command which can be built into a script?


Recommended Posts

  • Newbies

Does filemaker pro 16 have a "send in mail" command which can be built into a script?

I seem to be missing something obvious.

I have a script which I want to send an email to each customer in a set of found records.

I can by using the send mail script command create a new email for each record, insert each individual email address, add to the subject matter and include a personalised note.

What I can't seem to do is send a PDF of the record,(which is a laid out invoice with a graphic letterhead).

If I don't use this script and simply use “send in Mail” from the print dialogue box it puts the invoice in a new email but I don't get the insertion of the email address, subject and covering letter.

The only thing this script will attach is a file with the complete found set to each customer. Obviously not what’s required.

I’m running OSX 10.14 .6 and Apple’s Mail programme and Filemaker 16.06.600

Thanks for any help.

Link to post
Share on other sites

Here's a better search for you:

filemaker email attachment loop

Your script will need to use a loop to create the individual PDF and send it.

Link to post
Share on other sites
  • Newbies

Thanks guys.

Fitch I'm already using a loop. Please see the attached pic of the script.

Comment, that option works for saving or printing. It's exactly what I cannot find to use in the script. It's such a simple but necessary filter that I conclude I must be being stupid as I cannot see Filemaker not providing it.

I have no need to save the PDFs. If I have to that's fine, they can be deleted after the run is complete. I'm only using them as a universal pic format any customer should be able to read.

Untitled copy.jpg

Link to post
Share on other sites
9 minutes ago, Dijit said:

It's such a simple but necessary filter

I'm not sure I understand what you mean by 'filter'.

The way to do this is to use the "save record(s) as PDF" and use the Get(temporarypath) plus a file name.  Store that full path in a variable and you can then use the full path variable in the Send Mail script step for the attachment to your email.

And since you use the Get(TemporaryPath) you don't need to worry about cleaning up the PDFs, they will be deleted automatically when the script is done.

 

Link to post
Share on other sites
On 6/29/2020 at 1:30 PM, Dijit said:

I'm already using a loop. Please see the attached pic of the script.

That "loop" makes no sense to me. If - as you said in your original post - you:

On 6/28/2020 at 5:27 PM, Dijit said:

want to send an email to each customer in a set of found records.

then your script should be structured along the lines of:

# AFTER ESTABLISHING A FOUND SET
Go to Record [ First ]
Loop
   Set Variable [ $filePath ; Get ( TemporaryPath ) & YourTable::SerialID & ".pdf" ]
   Save Records as PDF [ File Name: "$filePath"; Current record ]
   Send Mail [ To: YourTable::Email; Message:"Say something nice here"; Attachments: "$filePath" ] 
   Go to Record [ Next; Exit after last ]
End Loop

 

Edited by comment
Link to post
Share on other sites

If you need more customization, you can switch to MBS FileMaker Plug-in for sending emails.

Using SMTP via CURL functions, you can send emails. Check our SendMail functions to build email with/without HTML, multiple attachments and properly encoded names & texts. See this tutorial: Sending emails in FileMaker with MBS Plugin

We can even configure it for Outlook 365, Google mail and others. No problem there.

Or if you like to send via Outlook, please check our new WinSendMail functions in our plugin. They can send via Outlook, Thunderbird or other MAPI clients, independent of 32/64bit issues and with a few more options. see Send emails via Outlook

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.