Submit choice and send automatic email

Submit choice and send automatic email

by Emma-Lee Yarwood -
Number of replies: 4

Hi all

I'm trying to develop our organisation's Moodle site, but I'm having to teach myself all about PHP (I'm an historian!!) and need to tweek the Choice module so that when a member of staff clicks the submit choice button a confirmation email is sent to them.

Can anyone point me in the right direction of how to start please? I want to try to write the code myself, but I'm having trouble identifying which bit of code needs adding to/modifying. I keep thinking I've found the answer, and then I start to doubt myself. I (currently) think it's something in the mod_form.php file?

Any pointers will be gratefully received! I'm finding my lack of understanding frustrating!!!

ETA: We're using Moodle 1.9+

Average of ratings: -
In reply to Emma-Lee Yarwood

Re: Submit choice and send automatic email

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

the function you are looking for is in

/mod/choice/lib.php

choice_user_submit_response

In reply to Dan Marsden

Re: Submit choice and send automatic email

by Emma-Lee Yarwood -

Thanks so much Dan. Fingers crossed I can make it work...!!

In reply to Emma-Lee Yarwood

Re: Submit choice and send automatic email

by Emma-Lee Yarwood -

Actually, can anyone help me please?

I've been pulling my hair out over this, and I really can't make this work. I'd be so grateful for any pointers. Please.

Thanks in advance,

Em

In reply to Emma-Lee Yarwood

Re: Submit choice and send automatic email

by Robin Schröder -

Hey,

did u get it workable? smile If so, how did u do this?

Have a nice day,

Robin