Email Notifications

How can I add Email Notifications to my solution?

Notifications are built into DayBack, and if you're using FileMaker Server, you'll find this really easy. We have a example script in there that emails resources about appointments coming up in the next x hours. This script can be scheduled to run on FileMaker Server every x minutes and work like a charm. Read through the notes here and then duplicate this set of scripts to use as a model for additional notifications you may need.

First, find the "Email Notifications" folder of scripts and edit the script "Configure Mail Server Settings" to teach the solution about your mail server. Once you think you have the settings correct, run the script "Test Server Configuration" to check it out. You may see an error if you've mistyped something. Keep refining the settings until you get a test message to go though. You'll only have to do this once as all our email notifications use the same settings.

Next, check out the example notification scripts; these really only have two moving parts:

1. Edit the script "Notification 1 - Find Events (SourceNo)" to script a find for the records you want to email about. In example 1 this script finds all the events coming up in the next x hours that have not yet had a notification sent. You can run this script on its own to make sure it is finding the right records. Be sure to send a script parameter to it declaring which Source Number you want to search.
2. Edit the script "Notification 1 - Send one notification -- message content is edited here --" and you'll see a number of variables you can edit to determine who gets sent the notification and what the message looks like.

That's it. Once you have these calcs the way you like them, you can create a schedule on FileMaker Server to run the notification every so often. You'll have the server run the "main" script: in this example it's "Email Notification 1 - Notify Resources of Upcoming Events".

How do I create a Schedule in FileMaker Server?

This is very easy, but beyond the scope of our docs. You'll find step-by-step instructions here (look at page 52 or just search for "script"):

Can I run notifications if I don't have Server?

Yes, but get Server. Your data deserves it.

To run this without server you can always use a "robot" machine: a FileMaker client running a plugin that can triggers scripts every X minutes. If you're thinking about this... get Server. Seriously.

If you want to run the notifications on FileMaker client--as soon as an event is edited, for example-- this can be done, but the user will feel a little pause as the event is emailed out.

Here is how to implement this...

1. You'll use the same configuration script described above, so configure and test your SMTP connection using the "Configure..." script mentioned above.
2. You'll also use the script "Send one notification -- message content is edited here --" described in #2 above, so edit that and make sure it is using the values you want to the recipient, subject, body, etc.
3. Once those two scripts are in hand, you'll call the "Send one notification -- message content is edited here --" script when you're ready to send the notification. Fortunately we're already looking to see if an event has been modified, so you can tie into that to send your notifications.
3.1 Find the script "Close Event Window & Refresh Calendar" (this is the script we run when you click the "continue" button at the bottom of the Event Details mini window. Edit this script and find the comment "Query our modification tracker". In the next space between script steps add an If / End If pair of steps. The calc for the If() should read:
$sc_UnModified ≠ 1
After that if statement, call your "Send one notification -- message content is edited here --" script. That's it.
4. Caveats. Since users can edit events outside this Event Detail mini window, or even just close that window without running our script, this isn't as reliable as running the script from the server. On the server we search for matching events, no matter how they were edited.

SMS: Can I send SMS instead of email notifications

Yes. The email described above can easily be an SMS if you know the recipient's carrier. For example, if the recipient is on AT&T, sending them an SMS is done by emailing [email protected]

All the major carriers work this way and you can find a list here:

If you'd like to go further and customize the message format (SMS messages sent via email have "FRM" for from and "SUB" for subject), or you'd like people to be able to reply to these messages and have these replies cause actions in FileMaker, we can help you do stuff like that by connecting FileMaker to the message service Twilio. Lots of possibilities there.

Going Further

If you need help writing additional notifications, Twilio integration, or automating processes in your solution, get in touch and we can discuss the mods you're interested in and get you a quote.

[email protected]
Follow us: