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

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

by Net Vicious -
Number of replies: 0

Dave, I modified a bit your code to avoid the deprecated is_siteadmin() function.

Only the users who have the capabilities of editing profiles or modifying the site config will see and use the new function.

$sys_context = context_system::instance();

if ( has_capability('moodle/site:config', $sys_context) or has_capability('moodle/user:update', $sys_context) ) {
    echo "<h2>Sending eMails</h2>";
    flush();
    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>";
    } 
}

unset($sys_context);
Average of ratings: Useful (3)