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

  • Paulo Bagorro
    Fri, 10 Apr 2020, 1:30 AM
    Is it possible to place the plugin on the login page? How?I need a "Contact us" for unregistered users.
    Thanks
  • Michael Milette
    Fri, 10 Apr 2020, 11:52 PM
    Hi Paulo, It is definitely possible. Here is what you need to do:

    1. Go to Site administration > Plugins > Authentication > Manage authentication
    2. Scroll down to the Instructions field.
    3. Insert your form in this field
    4. Click Save Changes at the bottom of the page.

    That's it! Your form will now appear in the section of the page called "Is this your first time here?" on the Moodle login page.

    With that said, if what you really want is to have the ability to approve any registration requests on your site, you might be interested in taking a look at the "Email-based self-registration with admin confirmation" plugin. New users complete would then complete the self-registration process. However, before they can gain access to the site, a Moodle Administrator will receive an email and need to approve. I have used it on a couple of Moodle projects and it seem to work well. You can find the plugin by going to https://moodle.org/plugins/auth_emailadmin

    Hope one of these solutions help!

    Michael Milette
  • Paulo Bagorro
    Sun, 12 Apr 2020, 2:18 AM
    Thanks Michael Milette
  • Michael Milette
    Fri, 17 Apr 2020, 1:46 PM
    Hi Paulo, I just noticed a bug in FilterCodes where it was identifying guest users as logged-in. If you have enabled guest access to your site, you may want to download the latest fixed version currently available on my GitHub site. The bug fix will be included in the next release of Filtercodes.
  • Anisorf Avecok
    Tue, 12 May 2020, 4:40 PM
    Hi @Michael Milette and all "Contuct Us" contributors.
    Thanks for sharing this plugin with the community.

    I'm having troubles on using the plugin with not authenticated user, it gives me " Invalid $user parameter in get_user_preferences() call". I've checked the configuration of the plugin and I have set Loggin required: false.
    I use the classical template from README.md section Cutom Methods with reCaptha and I have FilterCodes plugin from which I use only {wwwroot}.

    What am I missing?
  • Michael Milette
    Wed, 13 May 2020, 12:36 PM
    Hi Anisorf, It's not you, it's me. You didn't miss anything. I did.

    There was one spot in my code that resulted in people logged-in as guests as actually being logged-in. The issue has been resolved and the fix will be included in the next release of Contact Form just before the launch of Moodle 3.9 in June. HOWEVER, I would really appreciate it if you would download the latest version from https://github.com/michael-milette/moodle-local_contact, try it out and let me know if it resolves your problem. Thank you very much for bringing this issue to my attention.

    By the way, since you have FilterCodes, you might be interested in trying out the - new {formsupport} tag or {formcontactus} tags (there are a few more) which were introduced in the November 2019 release. No need to mess around with HMTL. To use it, just add one of these FilterCode tags to a page on your site and you will get an instant form ready to be used. The resulting HTML it produces will be very similar code to that you found in the examples. If you need to customize the form, you can do so using the Moodle language pack editor included with Moodle.

    Thank again for your question, Anisorf. I appreciate having the opportunity to fix that issue and look forward to hearing if this resolved your issue.

    Best regards,

    Michael
  • Anisorf Avecok
    Thu, 14 May 2020, 5:15 PM
    Dear Michael, thanks for prompt response.

    I tried the ready to go filtercodes forms, but I choose HTML since I need to customize the labels of the form in a non english language, and if I'm not wrong this is not fully supported in the language pack.

    I did install the github version of the plugin and I confirm that it works well for the not authenticated users except in these two (not common) cases:

    - A user is not logged in but he has an account in moodle. In this case when email of this kind is used I get as a status message

    Invalid $user parameter in get_user_preferences() call
    Debug Info:
    Error code: codingerror
    Stack trace:
    line 2108 of /lib/moodlelib.php: coding_exception thrown
    line 381 of /local/contact/classes/local_contact.php: call to get_user_preferences()
    line 318 of /local/contact/classes/local_contact.php: call to local_contact->moodleuserstatus()
    line 138 of /local/contact/index.php: call to local_contact->sendmessage()

    - Or if I do it second time in the same browser without clearing the browser cache, and again like a non authenticated user but using a mail that is present in the moodle DB, I get:

    Invalid get_string() identifier: 'duplicateemailaddresses' or component 'local_contact'. Perhaps you are missing $string['duplicateemailaddresses'] = ''; in /var/www/vhosts/aicadigitalacademy.it/httpdocs/aica_academy/local/contact/lang/en/local_contact.php?
    line 353 of /lib/classes/string_manager_standard.php: call to debugging()
    line 7298 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
    line 394 of /local/contact/classes/local_contact.php: call to get_string()
    line 318 of /local/contact/classes/local_contact.php: call to local_contact->moodleuserstatus()
    line 138 of /local/contact/index.php: call to local_contact->sendmessage()

    Thank again for your support.

    Best regards,
    Frosina
  • Michael Milette
    Sat, 16 May 2020, 1:29 AM
    Thanks for the feedback Frosina, I will take a look at that this wekeend.
  • David Samir
    Sat, 16 May 2020, 9:12 AM
    Dear Michael,

    the plugin works great, I've been using it for a while now and I really love it

    the thing is,
    I've been trying to submit a form for multiple recipients at once
    and I can't see anything in the documentation explaining how can I achieve that

    not sure if I could do that or not
    Kindly let me know if that's an option

    Thanks again
  • Michael Milette
    Sat, 16 May 2020, 9:31 AM
    Sorry David, the ability to send to multiple recipients is not supported. If you want to have multiple recipients, I recommend that you create a mailing list and then direct emails that list's email address.
  • Michael Milette
    Sun, 17 May 2020, 11:26 AM
    Hi Frosina,

    Contact does support mutliple languages are supported. All you need to do is to go into the Moodle Language Pack editor and add your translation for the plugin. Even better, contribute your translation in AMOS and it should be available in Moodle within a few days. Even the templates can be customized in the FilterCodes plugin making it easy to apply and update templates almost anywhere you want. Did you know? If you only use one of the Contact Form templates, you can put anything you want in the others to turn them into global blocks that you can stick almost anywhere in Moodle.

    On a side note, I will get back to you soon with the issue you reported. However, please report any bugs you find in the Bug Tracker in GitHub. The link to that that is on the plugin's page on Moodle.org.
  • Michael Milette
    Sun, 17 May 2020, 1:20 PM
    Hi Frosina, I think I have resolved your two issues. Please read the comments I posted for you in the bug tracker on GitHub and let me know how it goes:
    https://github.com/michael-milette/moodle-local_contact/issues/55
  • Balazs DaVinci
    Thu, 18 June 2020, 7:30 PM
    Hello Michael,

    This works within a Moodle page-activity but it doesn't work within a page created within the "Static pages" (local_staticpage) plugin.
    What could be the reason/issue?

    I have checked the following. E-mails can be send from Moodle, that works.
    Filter Codes are switched ON for content within the Filter settings.
    For the local_staticpage I have switched ON "processfilters" en disabled "cleanhtml".

    Thanks a lot for any tips and hints.

    Best Regards
    Balázs
  • Michael Milette
    Thu, 18 June 2020, 8:12 PM
    Hi Balazs, thank you for asking your question again. I did see your other message in my notifications but I think the site must have deleted it due to the source code because I could not find it anywhere.

    This issue has nothing to do with Contact form. Contact form is the form processor (i.e. only after you submit a form). At the stage where your form is being displayed, Contact Form is not yet involved.

    Based on what I could see in your previous screenshot, it looks like Static Pages doesn't like the carriage returns in the middle of an HTML tag. You could try removing them and let me know how it goes. For further assistance with this issue, please report using the Bug Tracker link on the Contact Form plugin page.
  • Pedro Perez
    Sat, 20 June 2020, 11:39 AM
    Hi Michael,

    Is it possible to use it to send to an external email and customize the names of the fields?
Please login to post comments