Moodle plugins directory: Contact Form | Moodle.org
Contact Form
The Contact Form plugin for Moodle processes information submitted through a custom web form, sending it by email to the site's support email address, if defined, or to the primary system administrator.
Examples uses for this plugin include:
- Contact us form.
- Support request form.
- Request a course form.
- Information request form.
- Lead generation form.
- Membership application form.
Share with us how you use this plugin on your site.
Note: This is not a web form builder but a form processor. You must have some knowledge of how to create HTML forms or at the very least be able to cut and paste the example included in the README file.
Contact Form templates
If you are not familiar with HTML, consider using the following easy to use plain text {form...} tags included with the FilterCodes plugin. These will generate a Contact Form templates and therefore require that you have the FilterCodes plugin installed and activated.
- {formquickquestion} : Adds a "quick question" form to your course. Form includes Subject and Message fields. Note: User must be logged in or the form will not be displayed.
- {formcontactus} : Adds a "Contact Us" form to your site (example: in a page). Form includes Name, Email address, Subject and Message fields.
- {formcourserequest} : Adds a "Course Request" form to your site (example: in a page). Unlike Moodle's request-a-course feature where you can request to create your own course, this tag allows users to request that a course they are interested in be created. Could also be used to request to take a course. Form includes Name, Email address, Course name, Course Description.
- {formsupport} : Adds a "Support Request" form to your site (example: in a page). Form includes Name, Email address, pre-determined Subject, specific Subject, URL and Message fields.
- {formcheckin} : Adds a "I'm here!" button to your to your course. Form does not include any other fields. Note: User must be logged in or the button will not be displayed.
The initial work for this project was sponsored by the kind folk at l'Action ontarienne contre la violence aux femmes. Contact Form benefits from ongoing development by TNG Consulting Inc..
I really like this plug-in. I am wondering.
Right now the fields name and email are required.
I know I will get questions regarding this, since users are already logged in.
I am wondering if there is a way to fill these fields automatically with the users profile details.
(maybe in away they can change it if they want).
Gemma
Unfortunately this is not possible to insert this information into the form using this plugin since the form itself is just HTML. However, let me give your question some thought and get back to you. I have a couple of ideas that might work for your situation which I will need to develop.
To ensure that this doesn't get forgotten, please add your suggestions to the bug tracker.
Best regards,
Michael
There is a new version of the plugin available on GitHub that may be of interest to you. This latest version no longer requires the name and email address if the user is logged-in. While this doesn't insert the information into the form fields as you were hoping for, you can now just eliminate the two fields from your form instead. Hope this helps. I have some additional work to do with the plugin before it is released on moodle.org but feel free to download it from GitHub. You'll find a link for this on the plugin's page on Moodle.org called "Source control URL" which will take you there.
As requested, I added an option to change the recipient according to a drop-down list. Alternatively, you can use a hidden 'recipient' field to specify the recipient. Be sure to consult the documentation on how to do this as it is a two step process. If you don't include a 'recipient' field in your form or you did not complete the two step process correctly, form submissions will still be sent to the site's support email address by default.
Hope this helps. I have some additional work to do with the plugin before it is released on moodle.org but feel free to download it from GitHub. The Source Control URL link on the plugin's page on Moodle.org will take you there. Please give this new version a try and let me know if you have any problems in the Discussion forum or the Bug Tracker. Both links are on the plugin's page on Moodle.org.
Best regards,
Michael
Thank you for your quick responses. For some reason I did not notice it until now. I will check out the new version. And will place the usercase/suggestion into the bugtracker.
Gemma
I installed your plugin. Now I am trying to insert a form into a block. When I insert the sample code and try to safe I get an error message. It says something like: "Wrongs sesskey, form not accepted." What am i doing worng? Do I have to insert a sesskey?
Take a look at the sample HTML source code of a form included with the documentation or on the plugin's wiki. You'll notice that there is a hidden field for the sesskey and some JavaScript. Both of these must be included in your form in order for it to work.
Hope this helps. If not, post a follow-up message in the Bug Tracker or Discussion forum (links on the plugin page) and I will see what can be done to help you out.
I have problem with this plugin. Installation and setup is OK, but when I click on Send button, my browser open blank white page without any content?
Thank you
To turn on Developer Debug mode, login to your Moodle site as an Administrator and click Home > Site Administration > Development > Debugging -- be sure to check the box next to "Display debug messages" if you want to see the errors on your screen. Otherwise they just end up in your log file.
IMPORTANT : Don't forget to turn debug off after you are done.
Hope this helps. If not, post a follow-up message in the Bug Tracker or Discussion forum (links on the plugin's page) and I will see what can be done to help you out.
Best regards,
Michael
There is only one thing not working at least for me: the subject field. If I include an input field with name "subject" the subject of the received email still remains the default one from the language file (New message)! Is there anything I am doing wrong?
Moodle 3.3.1, PHP 7.1
Kind regards,
George
everything is fine with the subject field! The German translation in AMOS for the required and optional fields (name, email, subject, message) has been changed, so after submitting the form the respective parameters are missing! Hence a multilingual usage of this plugin is not possible, the AMOS translations should be unified for the form fields concerned or maybe there is another approach to provide individual label translations...
I edited the language file locally, no issues while using different languages anymore!
Anyway, this plugin rocks!
Thanks for the feedback. I understand your concern. I have some ideas on how to address this and will try to implement a solution in the next release. In the meantime, instead of editing the language file locally, consider editing the language strings using Moodle's language tool. This approach will ensure that future updates of the plugin and the language packs don't override your string customisations. The tool actually looks and works in a very similar way to AMOS. You'll find it in your Moodle site by going to Site administration > Language> Language customization.
Thanks again for the feedback. Hope this helps.