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..
Thanks
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
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?
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
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
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
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.
https://github.com/michael-milette/moodle-local_contact/issues/55
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
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.
Is it possible to use it to send to an external email and customize the names of the fields?