Contact Form for Moodle (webmail)

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Number of replies: 22
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

This plugin is for administrators with a little knowledge of HTML forms. There is no special activity, resource or block for this plugin. It just uses a regular Moodle page or HTML block. Here is a little more information to help people get started.

To create a new form on your site:

  1. Go to the plugin's documentation. A copy of the documentation is also included with the plugin.
  2. Scroll down to the "Usage & Settings" section. There you will find an example of HTML code for a Contact Us form. Copy this to your clipboard.
  3. Create a new Moodle page or HTML block on your Moodle site where you will want the form to appear.
  4. IMPORTANT: Switch to the Source Code view in the editor and then paste the form code you copied in step 2 above.
  5. Save your changes.

That's it! If email is properly setup on your Moodle site, the form should now just work.

Additional form examples are available in the plugin's Wiki on the Template's page. You can of course customize it to suit your particular requirements but be sure to always do so in the Source Code view in the Moodle editor.

Consult the plugin's documentation as there are certain elements of the form that must be present in order for it to work. The documentation also includes helpful troubleshooting information should you experience any problems in getting it to work.

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by senen garcia -

Hello, Michael, thank you for developing such a useful plugin. It is exactly what I was after when trying to replace the old quickcomments block.

I know it is a just html form, but I wonder whether it is possible to link the name of the sender to the user profile page so it is easier to search that user without starting a search among the accounts. Do yo know whether it would be possible?


Thank you once again for your work, time and help.


Cheers

In reply to senen garcia

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Senen,

Thank you for taking the time to ask your question. My apologies for the delay in getting back to you. I've been waiting for another plugin I recently created to be published here on Moodle.org. It's called FilterCodes and it will enable you to achieve the desired result. Once installed and enabled, you will be able to pre-populate your form with information from the user's profile using plain text tags like {fullname} and {email}.

In addition, the next release of Contact Form will make these fields optional but only for users who are logged-in. If you can't wait to try it, you can download an updated release of Contact Form from GitHub which includes this feature. Keep in mind that the GitHub version is currently under development and that the implementation might still change before it is released around November just in time for the next release of Moodle.

Let me know if you have any questions.

Best regards,

     Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by senen garcia -

Glad to hear that, Michael, I will give it a go for sure.


Thanks again for your time and sharing will.



In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by Kristin Merritt -

This is an awesome tool and I am hoping to find great use for it. I can not seem to find the settings for the plugin in my Moodle setup so I can set up alternate email addresses. 


Could you provide me a screenshot of what I should be looking for?

Attachment Local-Plugins.PNG
In reply to Kristin Merritt

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Kristin,

Thank you for taking the time to ask your great question. The answer is that you have found the right place but probably have the wrong version of Contact Form for Moodle. The feature you are looking for is actually in the next release of Contact Form which will be published around November, just in time for the next release of Moodle.

If you want to try it out sooner, you can download the plugin today (or when you read this) from GitHub instead of Moodle.org. Keep in mind that this version is under development so there might still be some changes before it shows up on Moodle.org.

Let me know if you have any questions. If you do try it out, feel free to share feedback.

Best regards,

     Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by Kristin Merritt -

Thank you so much for your response! I can't wait until the new version comes out. You have done an amazing job on a plug in that will be very useful to me!

In reply to Kristin Merritt

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thank you Kristin! That is very kind of you to say. smile

Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by M H -

Hi Michael, 

Thanks this is awesome just what I need. I have the same question as above how can I change the email address I want the form to go to. 

I can find it in local plugins but no settings are available for it? 




Thank in advance for your response and great job. smile 


Maria 


In reply to M H

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Maria,

Configurable recipients is a feature available as version [0.7.1] - 2017-06-12 of Contact Form for Moodle and is only currently accessible using the "Source Control" link found on the Contact Form plugin page. It's a manual installation for now but please feel free to give it a try. The documentation there includes how to use this feature.

An updated version of the plugin will be published on Moodle.org shortly before the upcoming release of Moodle 3.4 expected in November/December.

Hope this helps. Let me know if you run into any problems.

Best regards,

Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by M H -

Hi Michael, 

It worked a charm thanks its brilliant. One question if I want the email to go to two recipients it only goes to one as below even though they are both added at local plugin . I know you demo name choices but if i want two recipients to receive the information from the form? 

support|email|name

teaching|email|name 


<input type="hidden" name="recipient" id="recipient" value="support">

<input type="hidden" name="recipient" id="recipient" value="learning">


I am probably doing something wrong. 

Thanks in advance, 

Maria 






In reply to M H

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Maria,

Good try however what you have created is actually invalid HTML. First, regardless of the HTML tag, all ID's must be unique on a page. Same with "name" element of all form fields. When you have two named the same, only the information in the second one gets received by the server. The only input type that can have multiple fields with the same name is radio input types in a group - because you can only pick one at a time.

Anyway, the solution to your problem isn't in Moodle but in your email system. To achieve the desired result, you will need to create an email address or email address forwarder and then have that forward any emails it receives to any number of recipients you want.

Email forwarders is a feature available in most email systems. Unlike regular email addresses, forwarders don't store emails it receives but simply forwards the messages to one or more email addresses.

If that feature isn't available in your particular system, the next option is to create a regular email account and then use the Vacation forwarding feature. Depending on your email system, you can use this feature to send emails to multiple people. If it isn't obvious how to do this, try entering multiple email addresses separated by a colon or semi-colon. Example: maria@example.com;ann@example.com

Bottom line - Create one of these forwarding scenarios and then simply have Moodle send the emails to a single email address.

By the way, I just published a new release of Contact Form for Moodle. This new version includes the feature to select the recipient from a dropdown pick list. Read the documentation on how to set this up.

Hope you find this useful. Let me know if this solves your issue or if you have any questions.

Best regards,

Michael Milette

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by M H -

Hi Michael, 

Thanks a million. I have set up a shared mailbox so that has solved my problem. This is a really great. My next question is if I wanted to report on the data that is been sent through this is not possible at present or is it? The form is just forwarding information not storing it am I correct? 

Thanks in advance, 

smile 



In reply to M H

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Maria,

You are very welcome. I am always grateful to hear when people find it useful.

You are correct. Unfortunately for your situation, the form is just forwarding information not storing it anywhere. In the future (date to be determined). I plan to add logging of messages that are send however I was not planning to include the actual content of the message for privacy reasons.

Should you want either of these features quickly, I am available for hire wink

Otherwise, my suggestion would be to add a suggestion using the Issue Tracker link on the plugin's page with your feature request. Please be sure to include a description of what you need as well as an example of how it would be used (i.e. the what and why).

Of course you could always just add Google Analytics to the page though this would not necessarily indicate the number of messages actually sent.

Best regards,

Michael

In reply to Kristin Merritt

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Kristin,

I just released a new version of the plugin on Moodle.org which includes the selectable recipient feature you are looking for. See the documentation on how to set this up (it's not too difficult).

Hope you find this useful. Let me know how it works out and if you have any questions.

Best regards,

Michael Milete

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by Alex Ferrer -

Hi Michael,
I have created a form and I have inserted the html in the staticpage plugin, but the <input> is not displayed. What can be happening?

  • Moodle 3.3
  • Theme Clean

Thanks for your work.

Attachment image_form.PNG
In reply to Alex Ferrer

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Alex,

Thanks for your excellent question. The only time I have ever seen form fields disappear after saving is in when using the old TinyMCE editor instead of the newer Atto editor. With default settings, TinyMCE editor would filter out HTML form tags when you went to save it. If this might be your case, try switching to the Atto editor and give it a try.

If you really want to use the TinyMCE editor, you will need to modify it's configuration settings to allow form field tags. Once you save your form using the Atto editor, you can switch back to TinyMCE and the form will work for everyone. However, if you forget and edit the form with the TinyMCE editor again, the fields will disappear unless you modified the TinyMCE Configuration settings in Moodle. To learn more about customizing TinyMCE, see https://docs.moodle.org/34/en/TinyMCE_editor. As for the actual settings, you'll need to research that. Here is a link to help you get started: https://lmgtfy.com/?q=tinymce+input+field

If you figure out the TinyMCE settings, post them back here and I will include it in the FAQ for future versions of the plugin.

Let me know whether or not this was helpful.

Best regards,

Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by Alex Ferrer -
Hi Michael,
Thanks for your quick response.
I'm using the Atto editor, so I think that's not the problem. Also, if I add the form in an HTML block, it works. Can it be for the Staticpages block, where I'm putting the form? I also have a problem with another plugin with pages with Bootstrap code, which are not displayed correctly (I'm going to contact the developer to see if it's a problem with his plugin).
Could it be related?

Regards.
Alex.
In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by Alex Ferrer -
Hi Michael, I have found the solution!! The "problem" was in the staticpages plugin, which has a configuration option to clean the HTML code, where you have to select NO.
Thanks for your help and congratulations for your fantastic plugin.

Regards.
Alex.
Attachment configuration_html_staticpages.PNG
Average of ratings: Useful (1)
In reply to Alex Ferrer

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Alex,

I am glad you found the solution. Thank you for sharing it. I will add your findings to the documentation for the Contact Form plugin. Hopefully it may help others in the future.

Best regards,

Michael

In reply to Michael Milette

Re: Contact Form for Moodle (webmail)

by stavroula lalou -
Hello, i would like to add an html static page as a contact form and the message to be sent on a certain email address. Is that possible? Can you please help me!
In reply to stavroula lalou

Re: Contact Form for Moodle (webmail)

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Stavroula,

It is definitely possible to specify the recipient. The information you need on how to achieve this can be found by going to the following part of the README.md documentation:
https://github.com/michael-milette/moodle-local_contact/blob/master/README.md#user-content-optional-contact-form-for-moodle-settings

To summarize, you add the intended recipient to the plugin's list of potential recipients and then add a hidden field in your form to specify to which of those recipients should receive the message.

Hope you find this information useful.

Best regards,

Michael