FileMaker Integration with Mandrill

Revolution11 has had great success incorporating Mandrill, a scalable, secure delivery API for sending transactional emails from websites and applications for clients who need to send email from their FileMaker solution. Mandrill is easy to get to know and once established, works well for targeted e-commerce and personalized one-to-one messages. For our discussion we will explain how the Mandrill Sample File constructs the URL to send to the Mandrill API, which then sends the email.

The benefits of sending email via Mandrill can be seen here: Mandrill Features. We were impressed with the simplicity of the process, but wanted to also add attachments to the emails to cover the many times that would come in handy from a business standpoint.

The screenshot shows the basic email form – the user creates a free account at Mandrill, subscribes to a paid MailChimp account (a fairly recent requirement), then uses the Mandrill Sample File to fill out the To/From information and message (seen on the left) and easily add an attachment, if needed. The right side shows the visual output of the custom functions and calculations that are generated at Mandrill.

image1

This blog post from Digital Fusion gives great information on how to construct this file: Sending email from FileMaker using Mandrill. Now, on to the fun stuff with the custom functions needed to add the attachments…

Custom Function: mandrill_createRequestInsertURL

File > Manage > Custom Functions > Edit (to see it).

This function takes in all the parameters (Example: To, From, Subject, API key, etc.) and creates the URL Request.

This function also uses a helper function called escapeData that handles any special characters in the email address, subject, etc.  (Example: &, %, `, etc.)

Custom Function: mandrill_attachmentCodeInsert

This function helps handle attaching the file to the email. Read more about the gritty details here: Sending email from FileMaker using Mandrill 

Now that we’ve used our custom function to create our URL request, it’s time to create the “InsertURL Template.” This is a calculated field that we use to finalize our URL request to the Mandrill API.

File > Manage > Database > Select the “Insert From URL Template” > click on Options (lower right)

As you can see once you’re viewing the calculated field, this uses the mandrill_createRequestInsertURL custom function and creates the URL we send to Mandrill.

To sum up, this is the structure of the URL used to build this function. Inputs from these two field ultimately create the URL to be used.

URL to Mandrill API / Insert From URL Results

URL to Mandrill API is always the same and should be pre-filled into the corresponding field. Insert From URL Results is the result of the custom function, mandrill_createRequestInsertURL and is ultimately a calculated field.

Now that we have our URL, the hard part is done and we just need a simple script to send the email.

sendEmail Script

Now that we have our URL constructed, the sendEmail script is a simple process. The meat and potatoes of this script is FileMaker’s “Insert from URL” function. We just pass in two fields that create this URL. We pass in the “URL to API” which is a constant, and add our calculated “Insert From URL Results” field to the end of the URL, and we’re good to go.

Image2

Attach this script to the “Send Email” button and you’re done! We would love to get your feedback on this script and learn how it has worked for you.

Get a PDF of this blog here: FileMaker Mandrill Integration

 

FileMaker Integration with Mandrill

Why Use A Transactional Email Service?

Transactional Email

Businesses of every size rely on email as a basic process; therefore, setting up an email system is generally one of the first items on the list of to-dos. As the business grows, it soon comes to light that the existing email setup is not the most effective tool for the many types of emails that are useful to internal staff and those that affect your customers.

Bulk email solutions for notifications, reminders and other tasks, in general, are the worst tool for a job: your email (that you spent time and money crafting) will likely be marked as spam. Your account may be blocked if you try and send too may emails per hour and you soon realize that support for dynamic data driven HTML emails are seriously lacking.

What to do? This is where an email service such as Mandrill or Amazon Web Services, just two examples among many platforms, can fill the gap and add important functionality. Built for sending “transactional” emails, these solutions can easily integrate into your existing business solution.

Transactional email is targeted to an individual based on a prescribed action, or inaction, of the recipient. Think about order confirmations, notifications, reminders and a multitude of other services that you would not want to send out on an individual basis. This is where an email service comes to the rescue – check out these links for some great information on the importance of transactional email:

blog.mailchimp.com/what-is-transactional-email

mailjet.com/transactional

sendgrid.com/resources/what-is-transactional-email

blog.hubspot.com/marketing/what-is-a-transactional-email

When defining your business strategy it is important to know whether your emails are being opened, and if the embedded links are being clicked on – this is your first measure to see if the marketing campaign is successful. It is just as important to know how internal users are using email services. Over time, literally hundreds of reports may be created and sent out – who knows how useful the reports still are? Is that marketing report you set up in 1998 still being used?

Many of these transactional email services provide an easy way of sending HTML emails. These are great, not only for sending better-looking email with interesting photos and graphics, but they also allow the recipient to perform many actions beyond just replying to the email. For instance, recipients can open a website, initiate a phone call on their cell, or join a FaceTime conference on their Mac.

HTML emails even allow interaction directly with business systems. You can bring up a list of projects requiring your attention for that day with the click of a link in an email. You can drill down into further details of a product by bringing up its record and then view all related photos and documentation. Another benefit is allowing users to get rich, tailored, customized data from a business system, even if they are not allowed direct access; essentially you supply information while controlling by role. You can also allow tightly controlled input into your system with links to HTML forms online from customers and employees without giving them direct access to your system.

Email services, by their very nature, are built for easy integration. If you have ever had to deal with your IT department or large service provider to make changes to your email, you know the headache that comes with the change. Imagine the headache on an ongoing basis. By utilizing an email service you gain the ability to keep your primary email service nice and tidy and your IT folks happy, while allowing rich interaction with other applications and services.

Revolution11 has worked with several clients on transactional email integration within their FileMaker solution – please contact us for insight into the experience or assistance with setting up your own system.

Get a PDF of this post here: Transactional Email

Why Use A Transactional Email Service?