Hi i'm new in moodle, so i want some help from an expert...
Here it is... Imagine that you are in the forum area. You are adding a new topic for a lesson and you want to inform the students whre are subscribed in this lesson for this new thread by emailing them. So the only thing you have to do is to check the checkbox which is named as "E-mail", right?
I want somebody, to tell me, which are the php mail files, doing the mail processing. I made a lot of search and i can't find something relevant. Please if somebody can help me, i would appreciate it.
Sorry for my bad english!!!
Because nobody answered to my problem until now i will explain it differently...
In the forum there is a checkbox named "Email now"
All i need is the source code behind this check box... I guess that is the "process.php" file but i'm not quite sure, so i need and a second opinion from an expert... Please, it's important.... Thanks
In the forum there is a checkbox named "Email now"
All i need is the source code behind this check box... I guess that is the "process.php" file but i'm not quite sure, so i need and a second opinion from an expert... Please, it's important.... Thanks
I believe the location of the code is found in : /mod/forum/lib.php and post.php. The check box option is provided in post_form.php around line 62 in a 1.8 moodle version :
if (empty($post->id) && has_capability('moodle/course:manageactivities', $coursecontext)) {
$mform->addElement('checkbox', 'mailnow', get_string('mailnow', 'forum'));
}
You can only mail now if you have the capability to manage course activities.
Do a search for "mailnow" in the three files I mention to find the parts of the code where this is dealt with.
Hope that helps....
Steve
http://stcssafety.com
if (empty($post->id) && has_capability('moodle/course:manageactivities', $coursecontext)) {
$mform->addElement('checkbox', 'mailnow', get_string('mailnow', 'forum'));
}
You can only mail now if you have the capability to manage course activities.
Do a search for "mailnow" in the three files I mention to find the parts of the code where this is dealt with.
Hope that helps....
Steve
http://stcssafety.com
Thank you very much Steve... I will check it... Thanks again!!!
Even if you say mail now, I am not sure that it happens until the next cron job happens. But it does not wait for the editing time. (happy to be corrected here)
In /mod/forum/lib.php you will find the forum cron script.
this calls the function
email_to_user which can be found in
/lib/moodlelib.php
I am pretty sure that it is the email to user that does all the actual mailing,
Regards
Philip
In /mod/forum/lib.php you will find the forum cron script.
this calls the function
email_to_user which can be found in
/lib/moodlelib.php
I am pretty sure that it is the email to user that does all the actual mailing,
Regards
Philip
Philip
Are you sure that email_to_user function does the mail process while you check the checkbox "email now"?
Lef
Are you sure that email_to_user function does the mail process while you check the checkbox "email now"?
Lef
Fairly sure, but.....
I have added a line to mine (BCC) and I know that it is dealing with normal forum posts and messages, digests and admin error alert messages.
I have added a line to mine (BCC) and I know that it is dealing with normal forum posts and messages, digests and admin error alert messages.
In reply to Philip Percival
Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Lef Plom -
Ok Philip... Thank you very much...
I'll check it...
I'll check it...
In reply to Lef Plom
Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Steve Bilton -
Just checked the behaviour of the mail now check box.
It does ignore editing time, mine is set to 24 hours.
It only mails after the Cron has been run/scheduled.
Has anyone found a way to email tutors copies of the posts upon creation (ignoring editing time); and Students are then emailed copies of the post as default??
Steve
http://www.sheilds-elearning.co.uk
It does ignore editing time, mine is set to 24 hours.
It only mails after the Cron has been run/scheduled.
Has anyone found a way to email tutors copies of the posts upon creation (ignoring editing time); and Students are then emailed copies of the post as default??
Steve
http://www.sheilds-elearning.co.uk
In reply to Steve Bilton
Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Lef Plom -
I've only managed to send emails tutors by running cron only... I thing this is the only way to send mails through the forum....
Lef
Lef
In reply to Lef Plom
Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Lef Plom -
Hey i've got another (maybe silly) question
Is any relationship between function forum_cron(found on mod/forum/lib.php) and the php file cron.php(found on folder admin) in order to do the mail processing? Thanks and hope for replying...
Is any relationship between function forum_cron(found on mod/forum/lib.php) and the php file cron.php(found on folder admin) in order to do the mail processing? Thanks and hope for replying...
In reply to Lef Plom
Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Tim Hunt -
cron.php is the main entry point for all cron tasks. It's job is to find all the tasks that need to be performed and invoke them.
So, for example, one of the things that admin/cron.php does is to load the lib.php file from every module, and, if it finds a xxx_cron function defined in there, it calls it.
So, for example, one of the things that admin/cron.php does is to load the lib.php file from every module, and, if it finds a xxx_cron function defined in there, it calls it.
In reply to Tim Hunt
Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Lef Plom -
I see...
Thanks for responding....
Thanks for responding....
In reply to Lef Plom
Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Lef Plom -
How the files lib.php and moodle lib.php are connected? I mean which command does this fuction?
In reply to Steve Bilton
Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: Re: Απάντηση: mail php files
by Steve Bilton -
Hi,
To answer my own question I have made a small hack for moodle that will send tutors and admins copies of forum posts before they are emailed to subscribers.
The post is located here : http://moodle.org/mod/forum/discuss.php?d=118408#p534575
Steve
www.sheilds.org
To answer my own question I have made a small hack for moodle that will send tutors and admins copies of forum posts before they are emailed to subscribers.
The post is located here : http://moodle.org/mod/forum/discuss.php?d=118408#p534575
Steve
www.sheilds.org