
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.
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. If you are not familiar with HTML, consider using the {form...} tags included with the FilterCodes plugin. You are just one plain text tag closer to having a common webform than you think.
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..
Best regards,
Michael
My webhost crashed my site. They had some huge hardware issue. Fortunately, I saved my content, including my contactus.html file, and my sendmail.php file.
I am using Moodle 3.7.7. That is the most recent version my hosting company allows. I am not using SSL or TLS for my email.
I put the contactus.html in a static page, and the sendmail.php in the ../public_html/local/contact/ directory. This is the same way I had setup before.
I set up outgoing email in moodle, and tested it, it works fine.
But the contact form will not send emails. I am not sure how to trouble-shoot this.
I stripped down the contactus.html form because I kept getting sesskey errors. This was working fine:
-------------
---------------
Here is the sendmail.php
-----------------
<?php
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
mail($email ,$subject, $message);
?>
But, as you can see, there is nothing wrong with the html code, or php code. I have tried these outside of moodle, and they work.
If you are committed to making your code work, I suggest you ask your question in the developers forum. I will give you a hint though - you've stripped out too much code when making your sendmail.php.
Best regards,
Michael
I have created a mydomain@gmail.com account to use for outbound email on Moodle. This works on Moodle, I have ran the outbound mail test, and I have tested student self registration. I have done these tests multiple times, it always works.
But it does not work when using this plugin. I have put echo statements in sendmail.php to make sure that sendmail.php is being called correctly, and that all the information is correct. But the message is never sent to the mydomain@gmail.com account.
After installing this plugin to our Moodle version 3.0+ using PHP 5.4, I am not able to go back to site administration. I got the following error
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
Is there a way to resolve this? The clients do not want to upgrade their Moodle version.
Thank you