Enrolment

Is it possible to resend email confirmation messages in Moodle 1.8.4?

 
Picture of Bill Plumstead
Is it possible to resend email confirmation messages in Moodle 1.8.4?
 
I am using Moodle 1.8.4 and use "Email-based self-registration" and would like to be able to resend email confirmation messages. I've search the forums and didn't find any information on the subject. If there isn't a way to resend the email confirmation message, is it possible to reconstruct the confirmation link from data in the database? If so, what tables / columns contain the data needed.

Thanks,
Bill Plumstead
 
Average of ratings: -
Picture of Bill Plumstead
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
 
Greetings,

I found that you can reconstruct the confirmation link from data in the database. To reconstruct the URL, the link can be built by using the values of USER.SECRET and USER.USERNAME. Here's how the link would be constructed:

$CFG->WWWROOT/login/confirm.php?data=[USER.SECRET]/[USER.USERNAME]

Where $CFG->WWWROOT is the root of your moodle installation and [USER.SECRET] and [USER.USERNAME] are values from the USER table.

Thanks,
Bill Plumstead



 
Average of ratings: -
Picture of Jon Boggiano
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
 
Where does the [USER.SECRET] come from?
 
Average of ratings: -
Picture of Praveen Parihar
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
 
i am new to moodle ...can anybody pls help me how do i implement this functionality in my moodle site..
 
Average of ratings: -
Picture of Praveen Parihar
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
 
try this piece of code ....


Include this line of code in index.php which u will find in login folder


echo '<a id="btnresend" href="Resendemailmessage.php?'. send_confirmation_email($user). '">Resend Mail</a>';


 
Average of ratings: -
Picture of Dave Emsley
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
Group Particularly helpful Moodlers

Hi there,

I need to do this but I cannot find a file called Resendemailmessage.php

Where is it please?


Cheers


Dave

 
Average of ratings: -
Picture of Dave Emsley
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
Group Particularly helpful Moodlers

As I'm using Moodle 2.9.3 this file doesn't seem to exist, however there is a function within moodlelib.php called setnew_password_and_mail($user) which does this.

I've added the following code to /user/profile.php at the end of the file, under the line: echo $renderer->render($tree);

if (is_siteadmin()) {
    echo "<h2>Sending eMails</h2>";
    echo "email address is:<a href='mailto:".$user->email."'>".$user->email."</a>";
    if ($_GET['sendrenew']==1) {
        if(setnew_password_and_mail($user)) {
            echo "<br>Introductory email re-sent";
        }
        else {
            echo "<br>Introductory email failed to send";
        }
    }
    else {   
        echo "<br><br><a href='profile.php?id=".$user->id."&sendrenew=1'>Resend introductory email</a>";
    } 
}

Couple of things:

  1. I know my coding isn't great.
  2. I read somewhere that is_siteadmin() was being deprecated.


Hope this helps.

Dave Emsley



 
Average of ratings: -
Picture of Net Vicious
Re: Is it possible to resend email confirmation messages in Moodle 1.8.4?
 

Thanks Dave, I tested it on 3.0.X and runs perfect.


 
Average of ratings: -