Form Tools: generic form processing, storage and access script
Form Tools 2: Email Functionality Screenshots

One of the more powerful features in Form Tools 2 is its new email functionality and UI. This page shows a few screenshots of the various email pages with explanations about what options are available and how it all works. Nothing is set in stone at this point, but I feel that we're pretty getting pretty close.

As I've mentioned elsewhere, whenever you get into writing fairly large software you end up walking a fine line between usability and functionality. The more functionality you add, the more complicated the user interface ends up. So after reading this over, if anything is still unclear, please let me know by responding to this post.


Email Templates - Listing page

Unlike the current release, Form Tools 2 allows you to set up as many emails as you want - each going to whomever you wish.

This screenshot shows that the form ("My Example Form") has 3 email templates configured: "Admin Email" - which has been configured to be sent to an administrator list; "User Email" - which is sent to the user after they submit the form, and "Form Submission Edited" - a final email that is sent to the administrator (me) every time a submission is edited.

You'll notice that the third column denotes is View. A "View" is a way to view the contents of a form, limiting (if you wish) the form fields that are returned and/or the results themselves. For example, you may want to view only those submissions sent to a particular department, and only the contact information fields from the form. Views let you do precisely that.

Email templates are configured to be associated with a particular view so that (a) the contents of the emails that are sent are limited to those fields specified in the View and (b) they are ONLY sent if the form submission is visible in the View.

The "Is Active" column indicates that all email templates are currently "live" and will be sent whenever their criteria is met.

Editing an Email Template

Configuration

When adding/editing an email template, the first tab controls the various configuration settings for the template.

  • Email Template Name: this is used as a way for you to "tag" your email templates. It's used internally to help you identify your templates.
  • Is Active: this lets you temporarily disable emails being sent from this template, if need be.
  • When Sent: this option gives you a few basic options on when the email should be sent. Ultimately, I plan on expanding the "When submission is edited" option to let you precisely determine when the email should be sent (e.g. a field value changes to a particular value), but this feature may not appear in the initial release.
  • View: as mentioned above, this maps the email template to a particular View, so that (a) the contents of the emails that are sent are limited to those fields specified in the View and (b) they are ONLY sent if the form submission is visible in the View.

Headers

The headers tab lets you control the various headers sent with the email. First, the recipient list. The dropdown (although you can't see it) contains a number of predefined recipients known to Form Tools: the administrator account, any or all client accounts associated with the form and the user (the person who submitted the form). It also allows you to add custom recipients. You can add as many recipients as you wish for each email template.

Technically, you could enter the client email addresses all as custom email recipients, but the drawback would be that if any of them changed their email address, you would need to manually edit the email templates to update the email address. By selecting the known accounts (client, admin) through the dropdown, Form Tools will take care of this for you; it will know to send the email to the new address.

You may notice the "cc" and "bcc" text next to some of the email recipients. You have the option to indicate what recipient should appear as a cc, bcc or a main recipient.

Content

This bit probably looks fairly familiar to current Form Tools users. It's where you enter the content of the emails. You may note that the content looks a little different from the current release: that's because email content is now generated dynamically via Smarty templates. But like now, you can choose prefab email template content from the dropdowns (and in addition, you can also create your own prefab email content - not shown here!)


Test

Again, like now, there's an option to test an email template as your building it. The new layout groups this information on a separate tab.


Reference

And again, like the current release, there will be a "Reference" tab listing all the placeholders available to use in your form. Interestingly, there's now TWO ways to populate the content of your emails:

  • A Smarty loop. This method is used in the prefab email templates, found in the "Example templates" dropdown on the content tab. It generates the content by looping through all fields in the email template's View.
  • Manually referencing each placeholder. As shown in the screenshot, there are various placeholders like {$ANSWER_name} that you can manually enter into the email content. So if you have a very specific email layout that you want to acheive that can't be done simply by using the previous Smarty Loop option, this lets you do it!
Naturally we'll be documenting this feature thoroughly, but most importantly: you can generate you email templates simply by choosing the default or example options. It's only when you need to get into customizations that you'll need to learn a little more about how it works. So hopefully this should still keep it simple for the majority of users.

SMTP Option

There will also be an option - via a Module - to have the emails sent via SMTP. The user interface pages defined above will remain the same, however: you simply enable the SMTP settings and the script will know to use that server to send the emails.

And that's all folks! I'll post more screenshots of the various components as they are finished.