moodle-mod_customcert
moodle-mod_customcert copied to clipboard
Resending of certificates
When I created a new certificate for an existing course and deployed it, all users who had previously completed the course were emailed the new certificate. My intention was to only use the new certificate for existing and future users.
The steps I took were:
- using the custom cert plug in, create a new certificate template
- enter the course, use the template to create a certificate for that course
- set the email to student option to yes
- deployed the certificate and saved all changes.
I only found out about the emails when I started getting bounce back messages from those users who had changed or deleted their emails.
Brian
Thanks for the report Brian.
Currently this is not a bug and is actually expected behaviour.
I think there has to be a setting or something for the certificate to avoid this, like 'Only email students who are enrolled after this completion date'.
Thoughts?
I agree absolutely. I suspect many users have courses where the certificate might need to change but the course keeps going. Certainly I have another course where this is the case but have about 2,000 users who already have certificates… so, I’m a bit boxed as I want the new certificate but REALLY don’t want to send out 2,000 emails to previous students… and then deal with their questions and concerns about that email!
Your idea of a certificate mailing date switch is a great solution.
Regards,
Brian
On Aug 8, 2017, at 2:00 AM, Mark Nelson [email protected] wrote:
Thanks for the report Brian.
Currently this is not a bug and expected behaviour.
I think there has to be a setting or something for the certificate to avoid this, like 'Only email students who are enrolled after this completion date'.
Thoughts?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/markn86/moodle-mod_customcert/issues/127#issuecomment-320858684, or mute the thread https://github.com/notifications/unsubscribe-auth/AdRaHkr3fATODOZytBnboRD-rgQ9GWNSks5sV_mSgaJpZM4OsZVu.
As a work around for this issue (ie prevent users who have completed in the past from getting emailed cert) I did the following quick hack.
- Commented out the email function in the task - see below.
- Enabled the automatically email the students feature for a certificate.
- Waited for all the existing completed users to be issued certificates.
- Re-enabled the email function.
mod\customcert\classes\task\email_certificate_task.php
if ($customcert->emailstudents) {
$renderable = new \mod_customcert\output\email_certificate(true, $userfullname, $courseshortname,
$coursefullname, $certificatename, $customcert->contextid);
$subject = get_string('emailstudentsubject', 'customcert', $info);
$message = $textrenderer->render($renderable);
$messagehtml = $htmlrenderer->render($renderable);
// ### temporary disabled email ###
//email_to_user($user, fullname($userfrom), $subject, $message, $messagehtml, $tempfile, $filename);
}
I vaguely remember having this issue, and I think I might have originally set the Email others field to noone@invalid, or something like that, then changed the Email fields to the actual values after certificates were issued. Can't remember for sure though.