Blog

Freeform 1.4 and Freeform Widgets Bundle for Craft

The best just got better! Introducing Freeform 1.4 for Craft, and the new Freeform Widgets Bundle!

Email Notification Templates as Files

The key feature for this release is the introduction of HTML template files for email notification templates. Many of you have asked for this, and it's been on our roadmap to get this implemented. And for those that have always been happy with database email templates (managed in control panel), you can continue using it that way if you wish, as we're providing support for both approaches now.

As for email notifications as HTML template files, we weren't yet decided on how to handle this, as email notifications require a 'subject', 'from email address' and preferences such as including attachments or not. What we decided to do was build these into the notification template as a comment block of config-like variables. It gives you full flexibility and you don't need to pair up email templates with the other aforementioned data in the control panel. So by default, an HTML template file email notification will look something like this:

{# subject: New submission from {{ form.name }} #}
{# fromEmail: {{ craft.systemSettings.email.emailAddress }} #}
{# fromName: {{ craft.systemSettings.email.senderName }} #}
{# replyToEmail: {{ craft.systemSettings.email.emailAddress }} #}
{# includeAttachments: true #}
{# description: A description of what this template does. #}

<p>The following submission came in on {{ dateCreated|date('l, F j, Y \\a\\t g:ia') }}.</p>
<p>Here are the details:</p>
<ul>
{% for field in allFields %}
    <li>{{ field.label }}: {{ field.valueAsString }}</li>
{% endfor %}
</ul>

You can of course adjust those values to be anything you'd like.


Dynamic Template-Level Email Notifications

We also added a new feature that allows for dynamic template-level email notifications. This is handy if you want to do something like setting the notification email address to be passed from a custom field of another Craft element such as an entry. The code in action looks something like this:

{{ craft.freeform.form("composerForm", {
    labelClass: "form-label",
    inputClass: "form-control",
    submitClass: "btn btn-success",
    dynamicNotification: { recipients: ["kelsey@solspace.com", "support@solspace.com"], template: "templateHandle.html" }
}).render() }}

Freeform Widget Bundle

Lastly, available for Freeform 1.4+ is the new Freeform Widgets Bundle. This is a set of 4 widgets that allow you to display your form submissions or field values as colorful charts, in addition to displaying a list of recent submissions. Have a look at the screenshot below to see the widgets in action:

image


For the complete list of changes, refer to the changelog.

Like all of our addons/plugins, Freeform and the Freeform Widgets Bundle come with rock solid support and a 30 day no questions asked money back guarantee!