Joomla Forms Email Actions
Joomla Forms Email Actions
x
Creating new form and adding email action
This tutorial will show you how to create basic form in btForms and how to attach an
email action to this form
Preface ....................................................................................................................................................................3
Introduction ............................................................................................................................................................3
Creating basic form.................................................................................................................................................4
Create new form .....................................................................................................................................................4
Review and modify the form configuration .......................................................................................................6
Add form fileds ...................................................................................................................................................7
Final example form .......................................................................................................................................... 10
Form actions ........................................................................................................................................................ 10
Save submission to database........................................................................................................................... 11
Thank you – a simple thank you text ............................................................................................................... 12
Send an email .................................................................................................................................................. 13
Email Header ............................................................................................................................................... 14
Addresing ..................................................................................................................................................... 15
Email Content .............................................................................................................................................. 15
Attachments ................................................................................................................................................ 16
Permissions .................................................................................................................................................. 16
Mail server ................................................................................................................................................... 16
GPG Encryption............................................................................................................................................ 16
Joomla Global Configuration – Mail settings....................................................................................................... 17
Final result ........................................................................................................................................................... 17
Conclusion ........................................................................................................................................................... 19
2
Preface
bfForms is a Form generator for Joomla! CMS and is available for Joomla 1.5.x only. It runs in native mode and
does not rely on the legacy plugin - It has been designed to meet all your form needs and provide a whole
load more than just forms! (Submissions Management, Uploaded File Manager, Export Options).
In first series of tutorials for btForms I explained how to install btForms on your Joomla based web site.
This tutorial will teach you how to create basic form and make it to send user submission to your email
address.
Introduction
Creating forms on websites is hard, real hard - so we have taken the burden for you and created a VERY EASY
TO USE form builder for Joomla 1.5 that anyone can use.
Build on 4 years of experience developing form creators (Phil-A-Form) for CMS's such as Mambo and Joomla -
bfForms has been written from scratch and provides many powerful integrated features such as Spam
Controls, Validation Rules, Filters, Custom elements, Export Options and much more.
The extension hosts a huge number of great features. Let us just highlight some of them:
Specifically designed for Joomla 1.5.x
Allows you to create unlimited forms, with unlimited fields and actions
All forms are xHTML and CSS2 valid
Joomla Forms is written by a very experienced Joomla/PHP Developer who has been awarded the
Zend PHP 5 Certified Engineer award!
Once purchased, you get free upgrades for life - with a smooth upgrade path at all times.
All forms can be enabled/disabled with a single click
Speedy configuration of forms using a 100% xAJAX admin interface
SECURE FORMS - you can force forms to only show on SSL Secure pages
Quick Start Guide To Creating Great Forms included
Complete Control Over Form Page Titles
Set a maximum number of submissions allowed on a per form or per user basis
Complete control over the text on the submit, preview, reset buttons
Form Preview mode, before submitting the form!
Complete form layout control using Smarty Templates and simple placeholders
Built-in, Transparent, spam controls - NO CAPTCHA AT ALL !!! (We do not believe in CAPTCHA)
3rd party Spam Plugins (Akisment and Mollom)
IP Banning
Blacklist Word Banning
Spam Idiot Checks!
Feature to allow you to add custom JavaScript and Custom CSS to the page
Over 30 different, standard and custom, field types to choose from
Multiple form actions to apply to submitted data
Form Fields are 100% CONFIGUABLE
Over 24 different validation rules can be applied to each individual field
Or create your own with Regex!
3
7 Different filters can be applied to change the submitted value
You can specify a default value for each field - or allow it to be overridden by a string in the URL
Fields can be set as disabled
You have complete control over the class and style of each individual form element
Each field has its own access level and can be enabled for only Public, Registered or special users
On a per field basis you can restrict the allowing of the value to be sent by email or not.
All submissions can be saved to a built in database - or not! depending on your wishes
All submissions can be emailed to unlimited people - including the submitter
You can configure unlimited types of emails, each having their own content
You can set files that will always be attached to the emails sent (Like distributing terms.pdf)
You can allow uploaded files to be attached to the emails
You can encrypt any of these emails using GPG Encryption just by providing the public key
You can use any submitted value in the subject or body of any email with the use of simple
placeholders
I will show you how to create such form, how to attach an email action to this form and how to configure
Joomla to send data filled in form’s elements to your email address.
When the new screen shows up, click on “Create New Form” link on the left side menu:
4
Picture 2: Create New Form link
Enter the name of this form filed “Form Title”, the name which will represent the best this form and its
content. After that, click on a button “CREATE NOW!” to create new form.
Now that the form is created, select it by clicking on a check box next to its name and click on Edit button or
just click on its name in form list.
5
Review and modify the form configuration
The next screen will show up with further steps explained. Our first step is to review and modify the form
configuration so we can be sure that everything is set up as we wanted.
New screen will load up with just two options. Friendly name is the name that will distinguish this particular
form from the rest of the forms you might have on your website. Second option is the place where you can
setup page title on frontend of your web site. This page title will be shown in browser when your visitors
choose to fill in this form fields.
When you are finished with setting up those basic options, press Save button in top right side of the page.
6
Add form fileds
Now that we saved this form’s basic setting, it is time to add some form fields to this form. Click on the
following link to add new form field:
First you have to give some title for this field. This title will be presented to your visitors so choose the title
that will show your visitors what you expect from them to put in this field or how to react on the options that
this field might have. For our example form, we will ask our visitor to put full name in the first field of this
form so we will put the text “Your full name:” here
Next thing that we must do is to select what kind of form field this filed will be. For our example, we will
choose this field to be Textbox:
7
When you are finished with those two options, press “CREATE NOW!” button:
New page will show up with multiple tabs. Those tabs contain large amount of options, which we can use to
further customize our field. There are many options, validation rules, filters, permissions and style rules that
can be set and configured for every field in the form. For this basic example, we will just set up few options.
The rest of those options and rules will be explained in advanced tutorial.
First, we will set up friendly, internal field title. This title will help us to distinguish this form field in the list of
other form fields for particular form.
Public field title is title that will appear to your visitor. This is the place where you can adjust this field title
again, if you made some mistake during initial field creation.
8
Next thing that you should do is to setup this form field internal name. This name is used to create HTML
template for email confirmation, thank you email that can be sent after your visitors complete the form
submission etc.
This must be unique in this form; this means you cannot have two elements with the same system name!!!
You should also keep this quite short, for example: "lastname"
Finally, enter description of this particular form field. This description will be placed beneath form filed title
on your live form. That description is used to convey instructions to the visitor.
For this example, we will leave all other options on their default values. There is only one thing that is needed
to be done and that is to save this form field by pressing on Save button.
9
Final example form
Here is how this example form should look like after few more form fields placed on it:
Form actions
Our form would be just nice add on to our site and nothing more if there wouldn’t be something else that
would actually bring life to this form. That something is called “Form actions”.
Form actions are a way to communicate with our visitors when they fill in our form. You can use form actions
to save submissions to database, say “Thank you” to your visitors, and send them an email confirmation that
their submission if saved and that it is being processed or just redirect them to some other web page after
submission.
Let’s add some form actions. We will start by clicking on “Submit Actions” link on left side menu.
10
Save submission to database
We will define form action that will save data entered in form to a database table so we can browse those
data afterwards. First we have to give some title to this form action. This is our internal title so we can
manage multiple form actions with ease.
Set the type of this first form action to “Set submission to database”
Now, all we have to do is to click on “CREATE NOW!” button to confirm our selection.
This is very basic form action so we will leave the options on their default values by clicking on Save button.
11
Picture 23: Save form action options
Set the type of this first form action to “Thankyou – A simple thank you text”
12
Click on “CREATE NOW!” button to confirm our selection.
We will see the following screen. On that screen, you can type short message and thank you text that you
would like to present to your form submitters.
When you are satisfied with the thank you text layout and message itself, click on Save button
Send an email
Finally, we will define yet another form action that will allow us to send submitted data to an email or group
of emails.
13
Picture 29: Form action title
Since this form action is the most advanced one, we will have many options that we can set up for this action.
Those options are separated in tabs as you can see on the following picture:
I will list all the options for “Send an email” form action.
Email Header
This group of options consists of the following options:
14
You can also enter the name of a form field where the submitter will put their email address. For example, if
your form element was called "myemail" then you should enter #MYEMAIL# and Joomla Forms will replace
this with the submitted value
Addresing
This group of options consists of the following options:
Email Content
The body of the emails will be parsed by the action to replace placeholders with the values the visitor has just
submitted.
These placeholders are the HTML Field Name (Name) of the element, in uppercase, surrounded by #'s
15
Plain Text Email Body
If you would like to send a plain text portion of the email please add it here.
Example:
Attachments
This group of options consists of the following options:
Send submitted files, which have been uploaded, as attachements to this email
This relies on the file upload field having the permission to "send by email" set to yes
Permissions
This group of options consists of the following options:
Mail server
If the configuration you have set in Joomla Global Configuration is not compatible with your server then we
will never be able to send form submissions, Please check with your web host for the correct settings
We highly recommend SMTP with Authentication, as the most reliable and secure email transport - ask your
web host if this is available to you...
GPG Encryption
GnuPG is the GNU project's complete and free implementation of the OpenPGP standard as defined by
RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key
16
managment system with public key directories. GnuPG is also known as GPG. If you want your emails to be
encrypted - and very secure - then you might want to learn more about GPG
Final result
When everything is finished and your form tested here is how the result of form actions looks like (for our
example form):
17
If you click on Submissions link in left side menu, you will see all saved submissions that your visitors
submitted by filling out and submitting your form details:
18
Conclusion
This concludes my tutorial about creating basic form and attaching email action to it.
I hope that this tutorial will be useful to some of you.
If you have any questions regarding this extension, please, check our FAQ section or contact us by using
Contact link on our web site.
Author is working for Blue Flame IT company as freelancer in charge of writing extension documentation. You
can reach him through contact form on his web site http://www.mihha-vision.com or by writing him to email
[email protected].
19