The FileMaker Send Mail script step is a valuable function for developers, but in recent years has become unreliable. Many conventional email service providers have gradually made using Simple Mail Transfer Protocol (SMTP) relays more complicated, primarily due to security concerns. Here at The Support Group, we've been transitioning clients to Gmail or Azure Application Programming Interfaces (APIs), depending on their email provider. Another option is SendGrid from Twilio, but that's a different blog post. Now, FileMaker 2023 offers an enhancement to our Send Mail options, a game changer, in our opinion.
Open Authorization (OAuth) is a widely used framework that allows different applications to interact with one another. It's most appreciated for its ability to facilitate those interactions without having to share access credentials. Instead, a private key verifies the user's identity. It's relatively easy to implement and maintain.
While using the API is great, it involves a fair amount of advanced setup to get it to work. That was what was great about using SMTP via the Send Mail script. Like many other things in FileMaker, it is simple, effective, and easy to set up. However, now with FileMaker 2023, we have a new way of using the Send Mail script step.
This option hits the sweet spot between SMTP and an API integration as far as usability. With SMTP, we had to ask our IT department for specific settings – settings they had already completed for other users in most instances – and we were good to go. Our IT department will still have to do some work for the OAuth setup on their end. We won't go through the steps here but refer to these posts from Claris and Glenavon Technology. Please note that we found the Glenavon blog post left out one step; we had to enable the Gmail API explicitly.
The process takes about ten minutes for someone with Admin Access to the email provider's account. We need three things from them at the end of the process:
- Service Account Email
- Admin User Email
- Private Key
As detailed in the articles above, we can easily find all three things to set up OAuth access.
One thing to remember: be sure to save these settings somewhere because we will have to re-use them. We usually store them in a settings table or designated area of a solution so system administrators can access them quickly and update them if things change. For example, setting up our Google service account gave us the private key and the service account email in a JSON text file. A good practice would be to put that into a container field in our settings area for future reference and create separate fields for Service Account Email, Admin User Email, and Private Key input values.
Once we input that information, we're done! It should send an email just like the SMTP email version of the Send Mail script step. At the end of the day, much easier than attempting to set up API access through the Gmail API or some other third-party solution like SendGrid. And the new OAuth option is more secure than the old SMTP protocol settings.
Where the Perform Script on Server with Callback script step and the OnWindowTransaction script trigger are significant upgrades in FileMaker 2023, the OAuth component is one of those minor but powerful enhancements. It significantly improves the process of sending email messages from our FileMaker applications in terms of efficiency and security.
Join our mailing list to keep up with the latest FileMaker features and tips and tricks to advance your development skills.
This article is also published on FileMakerProGurus.com.