Guys, we know you're busy. If your calendars, desks, and plates are as full as ours, you probably don't have a whole lot of spare time. That's exactly why we created DNN Sharp Tip of The Week.
At around 10 minutes each (more or less), these tips and tutorials teach you everything you need to know about one specific topic. Armed with our tutorials, you'll be ready to implement cool stuff right away.
It's been said that the hardest part of any journey is taking the first step. In our case, we’re going to make it easy. It’s just eight little words. Ready?
How To Setup Action Form To Send Emails?
It may sound like a trivial task but there are a few things you have to look after if your emails aren't getting through.
Now, let's jump right in. So lets begin by creating a form with a subject and a message field.
Create Your Form
1. When the desired page is opened in Edit Mode, select the Modules option in the top menu; this will open the Add New Module window. Now select the Add New Module option.
2. Find avt.ActionForm and with Drag&Drop option add the module to your page.
3. Now you have installed Action Form Module on you desired pare. Currently the avt.ActionForm is not configured and you will need to do so by selecting Manage Form link.
Note that you will need to unlock the 30 Day trial or Activate for Production before you are able to see this screen
4. In this example we are going to create a Blank Form. Into the Manage Screen, click on the Start button for the Blank Form. You will be redirected to the form settings screen. You can also chose Contact Form, it actually does the same thing.
5. Just by clicking on the Fields tab, you will be redirected to the screen where you can add new fields.
In this example we will add the Subject and Message fields.
6. Now we are going to add the form fields. Go ahead and click on the Add Field button and select from the drop down menu the Text > Small Text for the Subject field.
7. Rename the title for this field into Subject and click on the Save button.
Repeat the 6 & 7 steps for the Message field with just a small difference; chose the large text option: Text > Large Text.
Setup The Email
For the Submit action, the form could be sent to an email, we need a button. From the Add Field drop down menu, select Buttons > Button, just like we did with the Subject and Message fields. Rename the button into Send (or whatever you want).
At the end, we will have this 3 fields.
Now lets configure the Send button; we are going to add some Actions for it.
1. Select the Button field. It will open the settings panel for the Send field. Scroll down to On Click Handler option.
2. Click on the Add Action button and from the drop-down menu select Email > Send Email. After this you will be redirected to the settings panel for the Send Email action.
3. On the Settings panel for the Send Email action (see the image below) we need to setup some details.
-
On the “To” field put in the email address where the form will be sent.
-
On the “Subject” field put in [Subject] token.
-
On the “Body” field put in the [Message] token.
After you finish setting-up these details, click on the Save button.
4. We can also add another action to display a message. This is useful to inform the user that the form was successfully submitted. For this, follow the 2-nd step but chose Message > Display Message option. This will open the Display Message settings panel. Put in the Message field your message (ex.: “Your message was successfully submitted.”). When you’re done, click on the Save button.
That's it. Now, let’s see you do the same!
Troubleshooting
Before starting everything, test that the form is working properly. Go to Admin > Event Viewer to see if you get any errors. If the form doesn’t work as it should be, you need to check some settings.
1. Make sure that the SMTP settings are configured properly. You can find this in Host Settings.
Follow this path: Host > Host Settings > Advanced Settings
Test that the Username and Password used to connect to the Server are correct. You can do this by clicking on the Test SMTP Settings button.
2. Make sure that the email address used to send the form is allowed to send emails. Action Form uses the system default (site email) which is the Administrator’s email. Some servers like Amazon needs that the email address used to send the form, to be verified. Only specific email addresses are allowed to send emails. In Event Viewer, you might get the next error:
So, if in Event Viewer you get the Email address not verified error, you need to set-up in the From field, the Host email address. The host email could be found under the Host > Host Settings > Basic Settings.
Follow this path to setup the email address: Manage Action Form > Fields > Send (submit button) > Send Email (action).
Click on the Save button and now your form should work perfectly.
A Video Is Worth A Thousand Words
I know that a video is worth a thousand words. That's why we've prepared a video tutorial on this topic. This video makes confused looks and skeptical questions a thing of the past. Be sure to watch it!
That’s all for today! Care to share a tip or trick with us?