Is there any way to stop the "Welcome to the course" emails being sent out? We have disabled the ability for students to edit their profiles, so this email is now irrelevant and causing some confusion.
Thanks
Don't know about stopping the mail itself, but you can change the text so it does not refer to the profile.
Look in lang/en/moodle.php
about line 1089 you should find the relevant text.
We replaced with spaces in case there was some fixed formatting in how the message was used by the system.
Doubt this will survive an upgrade. (we are using 1.4.3+)
I suspect there is a better/proper way of doing this from the tech experts, but this seems to do the job for the time being.
Andy
You could call it computer literacy: students will realise that not humans but automata create this kind of friendly messages...
Hello Klaus.
Thanks for your reply to this post. Sorry to piggyback off another topic, but based on your response, I was wondering if you could help me. We are using email authentication for new user signups. However, I wan't the confirmation emails that are sent to the users redirected to a specific email that I control. This will allow us to control who is creating an account by controlling whether they will be confirmed. If we decide to grant access, I can either select the activation link in that email or go through the edit user section under administration. Do you know where the code is that controls this confirmation email? Thanks for the help.
Ben
function send_confirmation_email($user) {
At the end of this function you will find the line return email_to_user($user, $from, $subject, $message, $messagehtml);
Replace this line withreturn email_to_user($from, $from, $subject, $message, $messagehtml);The user will no longer get the confirmation message. Instead, you will get it yourself and can confirm for the user.
return email_to_user($user, $from, $subject, $message, $messagehtml);
return email_to_user($from, $from, $subject, $message, $messagehtml);
Regards,return email_to_user($from, $from, $subject, $message, $messagehtml);but unfortunately not the monitoring:
return email_to_user($user, $from, $subject, $message, $messagehtml);
return email_to_user($from, $from, $subject, $message, $messagehtml);
In the first case I (admin) get the mail but in the second case only the user but not the admin receives a mail. email_to_user($user, $from, $subject, $message, $messagehtml);
return email_to_user($from, $from, $subject, $message, $messagehtml);
Regards, KlausHi Klaus,
I am interested in monitoring the self-registration process rather than stop it. I (the admin) want receive the confirmation and I want the user to receive the confirmation, too.
Following your post above, this is what I have included in the following file:
file ../lib/moodlelib.php
email_to_user($user, $from, $subject, $message, $messagehtml);
return email_to_user($from, $from, $subject, $message, $messagehtml);
However, only the user is receiving the confirmation e-mail. What am I missing?
Thanks in advance for your assistance.
Cindy
HI Cindy. Your post is dated of March 07 but maybe you have had an answer since.
I am interested to find out about it. Are you able to monitor the registration? Do you also receive a copy of the confirmation email? How did you do it? Can you give me the details? I am running Moodle 1.8, and you?
Let me know.
Thank you.
Sylvain
I would like to send the student's username and password in the email. What do I need to add to the statement to get that?
Rhonda
function send_confirmation_email($user) {
global $CFG;
$site = get_site();
$from = get_admin();
// $data->firstname = fullname($user);
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->username = $user->username;
$data->email = $user->email;
$data->sitename = $site->fullname;
$data->admin = fullname($from) .' ('. $from->email .')';Within your confirmation message (edit the value 'emailconfirmation' within ../lang/en/moodle.php) you can then use more valuables:
$string['emailconfirmation'] = 'Dear a->firstname $a->lastname ($a->username)
For your E-Mail-Adress ($a->email), an account has been... ';
>>You can stop moodle sending enrolment e-mails by comenting out two lines in the file:
.../enrol/enrol.class.php
or you could in Moodle 1.5. Anyone worked out how to do this in 1.6 ?
I'll answer this myself in case anyone comes across this thread later. The lines to comment out to stop "Welcome to the course" emails in a 1.6 installation are in ../enrol/manual/enrol.php.
(We do this because we leave course 'enrolment' open to all logged in users, ie we allow them click on any course area they wish, so we want to avoid them getting an identical ' Welcome to...' email, every time they wander of to explore some new area of our Moodle)
I want to send email to my students.But there is no line"email_to_user($USER, $teacher, $subject, $message);"in .../enrol/enrol.class.php.
class enrolment_factory {
function factory($enrol = '') {
global $CFG;
if (!$enrol) {
$enrol = $CFG->enrol;
}
if (file_exists("$CFG->dirroot/enrol/$enrol/enrol.php")) {
require_once("$CFG->dirroot/enrol/$enrol/enrol.php");
$class = "enrolment_plugin_$enrol";
return new $class;
} else {
trigger_error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist");
notify("Enrolment file $enrol/enrol.php does not exist");
}
}
}
Where should i add it?
Need your help.
Thank you .
What shoule I do in the 1.8.3 version?
enrol.class.php have been updated.
Has anyone got a solution for this in later versions of Moodle.
I am using 1.9.2
Hello Klaus.
I'd like to send a e-mail notification to the user (with the username and password) when the admin/teacher enrol him in a course.
Thanks a lot.
Noelia
Hi Ron,
I want send mail when an user is enrolled in a course (his account is already created). I also think it's a manual process; I think I have to modify some php functions, doesn't it? What function, do you know?
Thanks a lot.
Hi Ron,
Thanks a lot for your help.
Really I'd like this process (email welcoming - not sending password because user is already joined to Moodle - the student when the teacher adds him to a course) to be automatically performed. At first side, I think it's not possible to configure this feature in Moodle, so I have to edit Moodle source, isn't it?
Thanks.
Noelia
Hi Ron,
I'm using the 1.9.2 version of Moodle.
The mail could be somenthing like this (but in spanish ):
-------------------------
Dear user, (hear we can replace 'user' by the name of the user, but it's not very important)
You have been enrolled to the course "xxxx" (xxx=name of the course).
Regards
Moodle Adminstrator
--------------------------
Thanks. Noelia
Hi Ron,
Thanks a lot. You are rigth, but this option is only available when the user self-enrol in a course, but not when is enroled by the teacher/admininstrator. In my case, this option is not usefull because I want the teacher/administrator to be the one to register users in each course and the user to receive a notification email.
Noelia
Hi Ron,
Do you know which function I have to edit in source code for adding this feature?
Thanks. Noelia
Do you think I would be able to change this so it sends out a copy of the welcome message to the teachers so they are aware that they have a new student.
We are using 1.9
Sorry if I'm posting to the wrong group....
Similar problem. The automated email is being generated from one (of several) instructors/facilitators in the course. Is there a way to specify which person the email will be generated from when a user self enrolls in a course. We have multiple instructors and they would like the email generated from a particular instructor.
Can anyone tell me how $from is populated?
Tks, Jeff...
I have a similar problem posted here:
https://moodle.org/mod/forum/discuss.php?d=214592#p934782
The auto-emails being sent out to users every time they enrol on a new course, are being sent from a staff member on the course who is not the course leader. (I don't know how Moodle chooses the from person, but it seems almost arbitrary.)
How to I change the name of the 'from' person in these automated emails?
Thank you!