Contact Form

General plugins (Local) ::: local_contact
Maintained by Michael Milette
Contact Form is a Moodle plugin that allows your site to process and send information submitted through HTML web forms to the site's support email address or primary administrator if the support email address is not defined.
Latest release:
5343 sites
1k downloads
99 fans
Current versions available: 1

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..

Potential privacy issues

Reminder: Email message protocols may cross the Internet and store messages on mail servers in unencrypted plain text. If you are sending messages outside of your local area network, it is highly recommended that you do not use this plugin to collect sensitive information such as social insurance or credit card numbers. It has nothing to do with this plugin's functionality but just with the way email protocols work. This plugin on its own does not store any information - anywhere.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Michael Milette (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Gemma Lesterhuis
    Tue, 6 June 2017, 4:11 PM
    Hi Michael,

    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


  • Michael Milette
    Fri, 9 June 2017, 11:49 PM
    Hi 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
  • Michael Milette
    Sun, 11 June 2017, 2:42 AM
    Hi Gemma,

    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.
  • Michael Milette
    Mon, 12 June 2017, 9:51 PM
    Hi Bobby and Sheila,

    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
  • Gemma Lesterhuis
    Thu, 29 June 2017, 7:54 PM
    Hi 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
  • Gloria del Pilar Villarreal Cuéllar
    Mon, 3 July 2017, 12:03 AM
    Hi! I'm sorry to bother but I haven't been able to find an answer. I already installed and am able to see the contact form and it works great! The only issue is I would like the form to be sent after validating the recaptcha. I have already setup the recaptcha it's just that the message is sent whether or not they click on the recaptcha. I am new to configuration and don't know how to make this field mandatory or if there is more programming that needs to happen. TIA Any help is deeply appreciated.
  • Michael Milette
    Thu, 13 July 2017, 1:50 PM
    Hi Gloria, thank you for your question. I am glad you asked. It's no bother at all. Unfortunately recaptcha is not yet fully implemented. Half of the solution involves using a new plugin I recently created called FilterCodes. It is currently only available on GitHub at https://github.com/michael-milette/moodle-filter_filtercodes however, after a little more testing, I am hoping to have it published on Moodle.org in the near future. Amongst the many things it can do, it will insert the necessary recaptcha HTML code into your form. The other half involves making the Contact Form plugin handle the submitted recaptcha to ensure it is processed correctly. I am not sure when I will have the second part done but I will try to remember to let you know. If you want to ensure that I notify you, open an issue on the Source Code URL site and add a suggestion in the Issues suggesting that Contact Form include support for recaptcha.
  • Juliane Baier
    Mon, 17 July 2017, 10:12 PM
    Hi Michael,
    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?
  • Michael Milette
    Sat, 22 July 2017, 1:56 AM
    Hi Juliane, thank you for your question.

    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.
  • Zoran Milojevic
    Mon, 31 July 2017, 9:07 PM
    Hi Michael,

    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
  • Michael Milette
    Tue, 1 Aug 2017, 8:04 AM
    Hi Zoran, thank you very much for your question. Normally if there is anything wrong with your webform, you should see a message that says "Forbidden", not get a blank screen. What to do in the case of a "Forbidden" message is covered in the documentation for the plugin. Basically, set Moodle into Developer Debug mode and then try your form again. You should then see one or more messages appear that will tell you what's wrong with your webform.

    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
  • Michael Milette
    Tue, 1 Aug 2017, 1:52 PM
    Hi again Zoran, you may need to modify the URL in the ACTION parameter of the FORM tag so that it reflects the location of local/contact/index.php plugin. In the future, we will be able to work around this through the use of a new upcoming filter_filtercodes plugin.
  • Georg Wiesinger
    Mon, 7 Aug 2017, 10:58 PM
    Hi Michael, thank you very much for this great plugin! I love it and it works like a charm!

    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
  • Georg Wiesinger
    Tue, 8 Aug 2017, 3:42 AM
    Hi Michael,

    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! smile

    Anyway, this plugin rocks!
  • Michael Milette
    Wed, 30 Aug 2017, 10:33 PM
    Hi Georg,

    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.
Please login to post comments